Back to Devexpress

Session.GetObjectsByKey(XPClassInfo, ICollection, Boolean) Method

xpo-devexpress-dot-xpo-dot-session-dot-getobjectsbykey-x28-devexpress-dot-xpo-dot-metadata-dot-xpclassinfo-system-dot-collections-dot-icollection-system-dot-boolean-x29.md

latest3.0 KB
Original Source

Session.GetObjectsByKey(XPClassInfo, ICollection, Boolean) Method

Returns reloaded persistent objects with specified key property values from a data store.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public ICollection GetObjectsByKey(
    XPClassInfo classInfo,
    ICollection idCollection,
    bool alwaysGetFromDataStore
)
vb
Public Function GetObjectsByKey(
    classInfo As XPClassInfo,
    idCollection As ICollection,
    alwaysGetFromDataStore As Boolean
) As ICollection

Parameters

NameTypeDescription
classInfoXPClassInfo

An XPClassInfo object which contains the metadata information of the persistent class.

| | idCollection | ICollection |

A collection of objects representing the persistent object’s key property values.

| | alwaysGetFromDataStore | Boolean |

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

|

Returns

TypeDescription
ICollection

A collection of persistent objects with specified key property values.

|

Remarks

Firstly, the GetObjectsByKey method searches in memory for persistent objects with specified key property values. 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[])

How to: Obtain a Collection of Persistent Objects by a Set of Their IDs

Session Class

Session Members

DevExpress.Xpo Namespace