The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

BaseObjectSpace.GetObjects<T>(CriteriaOperator, IList<SortProperty>, Boolean) Method

Returns a sorted IList collection of objects of the specified type, retrieved to the current Object Space and filtered according to the specified criteria.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.2.dll

Declaration

public IList<T> GetObjects<T>(
    CriteriaOperator criteria,
    IList<SortProperty> sorting,
    bool inTransaction
)
Public Function GetObjects(Of T)(
    criteria As CriteriaOperator,
    sorting As IList(Of SortProperty),
    inTransaction As Boolean
) As IList(Of T)
public IList<T> GetObjects<T>(
    CriteriaOperator criteria,
    IList<SortProperty> sorting,
    bool inTransaction
)
Public Function GetObjects(Of T)(
    criteria As CriteriaOperator,
    sorting As IList(Of SortProperty),
    inTransaction As Boolean
) As IList(Of T)
public IList<T> GetObjects<T>(
    CriteriaOperator criteria,
    IList<SortProperty> sorting,
    bool inTransaction
)
Public Function GetObjects(Of T)(
    criteria As CriteriaOperator,
    sorting As IList(Of SortProperty),
    inTransaction As Boolean
) As IList(Of T)

Parameters

Name Type Description
criteria CriteriaOperator

A CriteriaOperator which specifies the criteria for object selection.

sorting IList<SortProperty>

An IList<SortProperty> object that specifies sorting.

inTransaction Boolean

true if all objects (in the database and retrieved) are processed by the specified criteria; otherwise, false. Has effect in XPO only.

Parameters

Name Type Description
criteria CriteriaOperator

A CriteriaOperator which specifies the criteria for object selection.

sorting IList<SortProperty>

An IList<SortProperty> object that specifies sorting.

inTransaction Boolean

true if all objects (in the database and retrieved) are processed by the specified criteria; otherwise, false. Has effect in XPO only.

Parameters

Name Type Description
criteria CriteriaOperator

A CriteriaOperator which specifies the criteria for object selection.

sorting IList<SortProperty>

An IList<SortProperty> object that specifies sorting.

inTransaction Boolean

true if all objects (in the database and retrieved) are processed by the specified criteria; otherwise, false. Has effect in XPO only.

Returns

Type Description
IList<T>

Only objects that satisfy the specified criteria will be retrieved to this collection.

Returns

Type Description
IList<T>

Only objects that satisfy the specified criteria will be retrieved to this collection.

Returns

Type Description
IList<T>

Only objects that satisfy the specified criteria will be retrieved to this collection.

Type Parameters

Name Description
T

Type Parameters

Name Description
T

Type Parameters

Name Description
T

Remarks

Below is an example of using the GetObjects<T> method. Here, objectSpace is the Object Space instance which can be accessed as described in the Ways to Implement Business Logic topic.

IList activeUsers = objectSpace.GetObjects(
    typeof(PermissionPolicyUser), new BinaryOperator("IsActive", true), true);

When implementing the IObjectSpace interface in the BaseObjectSpace class's descendant, don't implement the GetObjects<T> method. It's implemented in the BaseObjectSpace class. To get the specified objects, the BaseObjectSpace.GetObjects(Type type, CriteriaOperator criteria, bool inTransaction) method invokes a protected virtual CreateCollection method that does nothing and returns null. So, you should override the CreateCollection method in your descendant.

See Also