开发者

Looking for a .NET (Silverlight) library to represent data filter expressions [closed]

开发者 https://www.devze.com 2023-03-10 13:18 出处:网络
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 8 years ago.

开发者_开发知识库 Improve this question

There is a common scenario, where a client fetches data from the server using some kind of a filter.

I am interested to know what .NET (Silverlight) libraries are there to assist in representing such filters. In order to be really useful, the filter object model must possess the following qualities:

  • Be easily (de)serializable to something cross platform, like XML/JSON/plain string. For instance, linq expressions are not a good example, because they are not easily serializable. There are ways to convert linq expression to XML, but I cannot call them easy.
  • Be easily traversable in order to convert the filter into something suitable for data access. For instance, being able to translate the filter into a linq expression means that it can be fed into any DAL supporting linq expressions.
  • Support incremental construction and modification. Going back to the linq expressions, they support incremental construction, but not modification.
  • A really nice addendum would be a whole ready to roll Silverlight or HTML based UI component to let the user create such filters

Thanks.


WCF RIA Services will do that out-of-the-box for you. You expose collections of data as IQueryable, and can compose queries on top of that on the client side. When you execute the query, the whole query expression is sent back to the server, executed and the data returned.

Another option in a similar vein is WCF Data Services which essentially uses the query string to represent your query over a RESTful data set; on the server side this query is then transformed into an IQueryable and then executed on your underlying data store e.g. Entity Framework database. An example query to e.g. return top 10 products looks something like this:

http://localhost/myservice.svc/Products/$top=10

The queries are based on the OData standard. WCF Data Services can expose data as xml or json.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号