Skip to main content
.NET Framework 4.5.2+

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


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


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.


Type Description

A collection of persistent objects with specified key property values.


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.


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

See Also