Back to Devexpress

Session.GetObjectsByKey(ObjectsByKeyQuery[], Boolean) Method

xpo-devexpress-dot-xpo-dot-session-dot-getobjectsbykey-x28-devexpress-dot-xpo-dot-objectsbykeyquery-system-dot-boolean-x29.md

latest2.7 KB
Original Source

Session.GetObjectsByKey(ObjectsByKeyQuery[], Boolean) Method

Returns reloaded persistent objects from a data store, using queries based on specified object types and key values.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public ICollection[] GetObjectsByKey(
    ObjectsByKeyQuery[] queries,
    bool alwaysGetFromDataStore
)
vb
Public Function GetObjectsByKey(
    queries As ObjectsByKeyQuery(),
    alwaysGetFromDataStore As Boolean
) As ICollection()

Parameters

NameTypeDescription
queriesObjectsByKeyQuery[]

An array of ObjectsByKeyQuery objects, containing data for queries that retrieve persistent objects by specified object types and key values.

| | alwaysGetFromDataStore | Boolean |

true to reload persistent objects from storage if they are found in memory; otherwise, false.

|

Returns

TypeDescription
ICollection[]

An array of persistent object collections retrieved for query data passed as the queries parameter.

|

Remarks

Firstly, the GetObjectsByKey method searches in memory for persistent objects with specified values of the key property. If such objects are found, they are not reloaded. To get the up-to-date objects from storage, the alwaysGetFromDb parameter must be set to true.

Note

The GetObjectsByKey method does not find objects until they are saved to a data store.

See Also

GetObjectByKey

GetObjectsByKeyFromQuery(XPClassInfo, Boolean, String)

GetObjectsByKeyFromSproc(XPClassInfo, Boolean, String, OperandValue[])

Session Class

Session Members

DevExpress.Xpo Namespace