Back to Devexpress

IObjectSpace.ApplyCriteria(Object, CriteriaOperator) Method

expressappframework-devexpress-dot-expressapp-dot-iobjectspace-dot-applycriteria-x28-system-dot-object-devexpress-dot-data-dot-filtering-dot-criteriaoperator-x29.md

latest3.0 KB
Original Source

IObjectSpace.ApplyCriteria(Object, CriteriaOperator) Method

Filters the specified collection according to the specified criteria on the server side.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
void ApplyCriteria(
    object collection,
    CriteriaOperator criteria
)
vb
Sub ApplyCriteria(
    collection As Object,
    criteria As CriteriaOperator
)

Parameters

NameTypeDescription
collectionObject

An Object that is the collection to be filtered.

| | criteria | CriteriaOperator |

A DevExpress.Data.Filtering.CriteriaOperator object that specifies the criteria used to filter objects on the server side.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ApplyCriteria(Object, CriteriaOperator) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

XAF_Non-Persistent-Objects-Edit-Linked-Persistent-Objects-Demo/CS/EFCore/NonPersistentEditEF/NonPersistentEditEF.Module/BusinessObjects/ProductView.cs#L42

csharp
if(_Products != null) {
    ObjectSpace.ApplyCriteria(_Products, CriteriaOperator.Parse("? is null or Category = ?", Category, Category));
}

See Also

EFCoreObjectSpace.ApplyCriteria(Object,CriteriaOperator)

XPObjectSpace.ApplyCriteria(Object,CriteriaOperator)

IObjectSpace Interface

IObjectSpace Members

DevExpress.ExpressApp Namespace