The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

IObjectSpace.GetObject<ObjectType>(ObjectType) Method

Gets an object similar to the specified 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.v19.2.dll

Declaration

ObjectType GetObject<ObjectType>(
    ObjectType obj
)
Function GetObject(Of ObjectType)(
    obj As ObjectType
) As ObjectType
ObjectType GetObject<ObjectType>(
    ObjectType obj
)
Function GetObject(Of ObjectType)(
    obj As ObjectType
) As ObjectType
ObjectType GetObject<ObjectType>(
    ObjectType obj
)
Function GetObject(Of ObjectType)(
    obj As ObjectType
) As ObjectType

Parameters

Name Type Description
obj ObjectType

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

Parameters

Name Type Description
obj ObjectType

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

Parameters

Name Type Description
obj ObjectType

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

Returns

Type Description
ObjectType

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

Returns

Type Description
ObjectType

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

Returns

Type Description
ObjectType

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

Type Parameters

Name Description
ObjectType

Type Parameters

Name Description
ObjectType

Type Parameters

Name Description
ObjectType

Remarks

Use this method to check whether a particular persistent object belongs to the current Object Space. If the object passed as the parameter belongs to another Object Space, this method retrieves the same object from the database via the current Object Space.

When implementing the IObjectSpace interface in the BaseObjectSpace class's descendant, don't implement the GetObject<ObjectType> method. It's implemented in the BaseObjectSpace class. The BaseObjectSpace.GetObject<ObjectType>(ObjectType objectFromDifferentObjectSpace) method calls the BaseObjectSpace.GetObject(Object objectFromDifferentObjectSpace) method, which returns null. The latter method is virtual. So, you should override it in your descendant.

See Also