Back to Devexpress

IObjectSpace.GetObjectsQuery<T>(Boolean) Method

expressappframework-devexpress-dot-expressapp-dot-iobjectspace-dot-getobjectsquery-1-x28-system-dot-boolean-x29.md

latest2.8 KB
Original Source

IObjectSpace.GetObjectsQuery<T>(Boolean) Method

Gets a queryable data structure that provides functionality to evaluate queries against a specific business object type.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
IQueryable<T> GetObjectsQuery<T>(
    bool inTransaction = false
)
vb
Function GetObjectsQuery(Of T)(
    inTransaction As Boolean = False
) As IQueryable(Of T)

Optional Parameters

NameTypeDefaultDescription
inTransactionBooleanFalse

true , if querying a data store for objects includes all in-memory changes into query results; otherwise, false. Has effect in XPO only.

|

Type Parameters

Name
T

Returns

TypeDescription
IQueryable<T>

An IQueryable<T> object that provides functionality to evaluate queries against a specific business object type.

|

Remarks

You can use the following code to query data in EF Core and XPO applications:

csharp
IQueryable<Payment> query = objectSpace.GetObjectsQuery<Payment>(true);
object obj = query.Where(p => p.Hours == 4).FirstOrDefault();

The GetObjectsQuery<T> method has implementations in XPObjectSpace, EFCoreObjectSpace, and NonPersistentObjectSpace classes:

See Also

IObjectSpace Interface

IObjectSpace Members

DevExpress.ExpressApp Namespace