Back to Devexpress

XPObjectSpace.FindObjectSpaceByObject(Object) Method

expressappframework-devexpress-dot-expressapp-dot-xpo-dot-xpobjectspace-dot-findobjectspacebyobject-x28-system-dot-object-x29.md

latest2.7 KB
Original Source

XPObjectSpace.FindObjectSpaceByObject(Object) Method

Determines the Object Space used to load and save a specified persistent object.

Namespace : DevExpress.ExpressApp.Xpo

Assembly : DevExpress.ExpressApp.Xpo.v25.2.dll

NuGet Package : DevExpress.ExpressApp.Xpo

Declaration

csharp
public static IObjectSpace FindObjectSpaceByObject(
    object obj
)
vb
Public Shared Function FindObjectSpaceByObject(
    obj As Object
) As IObjectSpace

Parameters

NameTypeDescription
objObject

The object whose Object Space must be determined.

|

Returns

TypeDescription
IObjectSpace

An IObjectSpace object which represents the Object Space used to load and save the specified persistent object. null if the specified object belongs to an XPO Session not managed by the ObjectSpace class.

|

Remarks

This method is for internal use. It can access certain Object Spaces XAF uses internally (for example, the Object Space used by the Security System). Do not use such Object Spaces in your applications because this may cause unexpected behavior. Instead of this, implement the approaches below.

  • Within the object’s class code, use Session and its methods instead of an Object Space.

  • In other scenarios, create a new Object Space and use the GetObject(Object) method to retrieve an object in the current Object Space. Refer to the method’s description to see an example.

See Also

XPObjectSpace Class

XPObjectSpace Members

DevExpress.ExpressApp.Xpo Namespace