All docs
V20.2
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Standard 2.0+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

BaseObjectSpace.FindObjectSpaceByObject(Object) Method

Returns the Object Space used to load and save a specified persistent object. This method is for internal use.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v20.2.dll

Declaration

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

Parameters

Name Type Description
obj Object

The object whose Object Space this method returns.

Returns

Type Description
IObjectSpace

An Object Space used to load and save the specified persistent object. null (Nothing in VB.NET) if the specified object does not belong to any Object Space.

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.

  • To access an object's Object Space within class code, implement the IObjectSpaceLink interface in this class (in EF and non-persistent objects) or use the object's Session (in XPO persistent objects).
  • In other scenarios, create a new Object Space and use the GetObject(Object) method to retrieve an object in the current Object Space.
See Also