Skip to main content
.NET Framework 4.6.2+

Session.EvaluateInTransaction(XPClassInfo, CriteriaOperator, CriteriaOperator) Method

Evaluates the specified expression for objects of the specified type, taking into account all in-memory object changes.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.2.dll

Declaration

public object EvaluateInTransaction(
    XPClassInfo classInfo,
    CriteriaOperator expression,
    CriteriaOperator criteria
)

Parameters

Name Type Description
classInfo XPClassInfo

An XPClassInfo object that identifies the type of objects against which the expression will be evaluated.

expression CriteriaOperator

A CriteriaOperator object that specifies the expression to evaluate.

criteria CriteriaOperator

A CriteriaOperator object that specifies the filter criteria. The objects that match this criteria (based on in-memory object changes) will be used to evaluate the expression.

Returns

Type Description
Object

The value evaluated.

Remarks

To build the expression, use Aggregate functions or a combination of these functions. For instance, by using the “Count()” function (Aggregate.Count) it is possible to calculate the number of objects to be retrieved. The criteria parameter specifies the criteria used for object selection. The expression will only be evaluated against the objects that match the criteria. Set the criteria to null (Nothing in Visual Basic) to evaluate the expression against all classInfo objects in a data store.

To construct the expression and criteria, use the static CriteriaOperator.Parse method, which takes a string representation of the required expression and retrieves a corresponding CriteriaOperator object.

Note

The EvaluateInTransaction method returns the same result as the Session.Evaluate or Session.Evaluate<ClassType> method does with the Session.InTransactionMode property enabled.

See Also