Skip to main content
.NET 6.0+

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.v23.2.dll

NuGet Package: DevExpress.Xpo

Declaration

public ICollection GetObjectsByKey(
    XPClassInfo classInfo,
    ICollection idCollection,
    bool alwaysGetFromDataStore
)

Parameters

Name Type Description
classInfo XPClassInfo

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

Type Description
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