Skip to content

DevExpress-Examples/XDL_how-to-convert-the-criteriaoperator-to-a-lambda-expression-to-use-it-for-iqueryable-e2596

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files to look at:

How to Convert the CriteriaOperator to a Lambda Expression to Use It for IQueryable

Scenario

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

Implementation Steps

The static DevExpress.Data.Linq.Helpers.CriteriaToQueryableExtender class allows you to add extended methods for the IQueryable source, such as AppendWhere method. This method provides a capability to create a new IQueryable source, based upon the existing one, and add an additional Where condition to it. To extend the IQueryable source, add the DevExpress.Data.Linq.Helpers namespace in the using directive (or Imports for VB.NET).

NOTE: CriteriaToQueryableExtender, ICriteriaToExpressionConverter, CriteriaToExpressionConverterInternal, CriteriaToEFExpressionConverter and related APIs from the DevExpress.Data.Linq.Helpers namespace are internal and undocumented – please use them at your own risk:

  • We cannot guarantee backward compatibility and that these internal and undocumented APIs will remain unchanged in the future. We may not extend/evolve these internal and undocumented APIs.
  • We may not provide technical support for use of internal APIs – you may be asked to perform your own research.
  • We also do not guarantee that this approach will operate correctly with Criteria Language Syntax dialects for XPO, XAF, Dashboards, and other products. If you clarify your business requirements for these products, we will be in a better position to find a more reasonable solution for you – one that does not require the use of internal/undocumented APIs.

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)