Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BaseObjectSpace.GetObject<ObjectType>(ObjectType) Method

Retrieves an object from another Object Space to the current Object Space. The returned object is cast by the type designated by the specified generic type parameter.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public ObjectType GetObject<ObjectType>(
    ObjectType obj
)

#Parameters

Name Type Description
obj ObjectType

An object that represents a template object from another Object Space.

#Type Parameters

Name
ObjectType

#Returns

Type Description
ObjectType

An object retrieved from the database by the current Object Space and cast by the specified type.

#Remarks

To return an object retrieved by the current Object Space, the GetObject<ObjectType> method invokes the BaseObjectSpace.GetObject method passing the specified object as the objectFormDifferentObjectSpace parameter. The value returned by the invoked method is cast to the type designated by the specified generic type parameter. Note that the invoked BaseObjectSpace.GetObject method does nothing and returns null (Nothing in VB). So, it should be overridden in the BaseObjectSpace class’ descendants.

#Implements

See Also