Quantcast
Viewing all articles
Browse latest Browse all 7205

How to convert the CriteriaOperator to a lambda expression, so, the latter expression can be used in the IQueryable source

Imagine, that an end-user can build a filter criteria, e.g. by using the FilterControl, and you wish to apply this filter criteria to your IQueryable source.

The static DevExpress.Data.Linq.Helpers.CriteriaToQueryableExtender class allows you to add extended methods for the IQueryable source, such as AppendWhere method, for example. This method provides a capability to create a new IQueryable source, based upon the existing one, and add an additional Where condition to it. So, you can convert the CriteriaOperator to the corresponding lambda expression without any problem.

To extend the IQueryable source, it is sufficient to add the DevExpress.Data.Linqassembly to the References list and add the DevExpress.Data.Linq.Helpers namespace.

Please note that the DevExpress.Data.Linq.Helpers.CriteriaToQueryableExtender is an inner class, and we cannot guarantee that it will not be changed in the future.


Viewing all articles
Browse latest Browse all 7205

Trending Articles