Skip to main content
All docs
V23.2
.NET 6.0+

IObjectSpaceFactory Interface

Provides access to Object Spaces in ASP.NET Core applications.

Namespace: DevExpress.ExpressApp.Core

Assembly: DevExpress.ExpressApp.v23.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public interface IObjectSpaceFactory

Remarks

The IObjectSpaceFactory service allows you to use the DI-accessible API to create Object Spaces. Note that this service requires that IObjectSpaceProviderFactory is registered in your application. In applications created in v22.1+, the Solution Wizard registers this service automatically. In applications created in v21.2 and earlier, implement this service manually as shown in the IObjectSpaceProviderFactory description.

The IObjectSpaceFactory service is the analog of the CreateObjectSpace(Type) method. The main difference between these techniques is that the service does not require an application instance. This improves your application performance but leads to the following restrictions:

You can use the following Object Space Factories in different scenarios:

IObjectSpaceFactory
Creates Object Spaces for secured operations. In applications with the Security System, it ensures if the current user is logged on. Otherwise, it throws an authorization exception (refer to the following topic for information on how to avoid this exception: Access Object Space, Security System, Caption Helper, and XAF Modules in the ASP.NET Core Environment). Protected data is available depending on current user permissions. In applications without the Security System, this service operates the same way as INonSecuredObjectSpaceFactory.
INonSecuredObjectSpaceFactory
Creates Object Spaces for non-secured operations. These Object Spaces have full access to all objects and operations, despite user permission settings.
IUpdatingObjectSpaceFactory
Creates secured Object Spaces with additional permissions required for database update (for example, for new table creation). For more information, refer to the following method description: IObjectSpaceProvider.CreateUpdatingObjectSpace.

Refer to the following help topics to find examples on how to use this service in different scenarios:

See Also