Skip to main content
.NET 6.0+

XPCollection.Lookup(Object) Method

Retrieves an object from the collection by object ID.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v23.2.dll

NuGet Package: DevExpress.Xpo

Declaration

public object Lookup(
    object key
)

Parameters

Name Type Description
key Object

ID of an object to retrieve from the collection.

Returns

Type Description
Object

An object found or null reference (Nothing in VisualBasic) if an object does not exist in the collection.

Remarks

If the XPBaseCollection.LoadingEnabled property is set to true (default value) the collection will be automatically populated with data (if it’s still not populated) when its contents are accessed for the first time.

Note

The Lookup and Session.GetObjectByKey methods do not find objects until they are saved to a data store.

See Also