Skip to main content
A newer version of this page is available. .

IObjectSpace.CreateCollection(Type, CriteriaOperator) Method

Creates and initializes a collection of objects of the specified type, filtered according to the specified criteria.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

IList CreateCollection(
    Type objectType,
    CriteriaOperator criteria
)

Parameters

Name Type Description
objectType Type

The type of persistent objects to include in the collection.

criteria CriteriaOperator

The CriteriaOperator that specifies a criteria for object selection in a data store.

Returns

Type Description
IList

A IList collection that includes the persistent objects of the specified type. In addition, only objects that satisfy the specified criteria will be retrieved to this collection.

Remarks

Use this method to create a collection of objects of the specified type, filtered according to the specified criteria. The newly created collection will use the current Object Space to load and save persistent objects.

If you implement the IObjectSpace interface in the BaseObjectSpace class’ descendant, you should override a virtual protected BaseObjectSpace.CreateCollection method which is called by the BaseObjectSpace.CreateCollection method.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateCollection(Type, 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.

See Also