.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
A newer version of this page is available. Switch to the current version.

XPQuery<T>.TransformExpression(Expression<Func<T, Boolean>>) Method

Converts a lambda expression into an instance of the CriteriaOperator class descendant.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public CriteriaOperator TransformExpression(
    Expression<Func<T, bool>> expression
)
Public Function TransformExpression(
    expression As Expression(Of Func(Of T, Boolean))
) As CriteriaOperator

Parameters

Name Type Description
expression Expression<Func<T, Boolean>>

A lambda expression.

Returns

Type Description
CriteriaOperator

An instance of the CriteriaOperator class descendant that represents the lambda expression.

Examples

In the following code snippet the customers collection will contain only the customers named "Bob":

using DevExpress.Xpo;
using DevExpress.Data.Filtering;

//...

Session MainSession = new Session();
XPQuery<Customer> customersQuery = new XPQuery<Customer>(MainSession);

CriteriaOperator criteria = customersQuery.TransformExpression(c => c.Name == "Bob");

XPCollection<Customer> customers = new XPCollection<Customer>(MainSession);
customers.Criteria = criteria;
See Also