.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

CreateCustomObjectSpaceProviderEventArgs.ObjectSpaceProviders Property

Specifies a custom list of Object Space Providers to be used by the application.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v21.1.dll


public List<IObjectSpaceProvider> ObjectSpaceProviders { get; }

Property Value

Type Description

An IList<IObjectSpaceProvider> list of custom Object Space Providers to be used by the application.


When several Object Space Providers are passed to the ObjectSpaceProviders property, the Object Space Provider appropriate for each particular business object type is determined automatically (see How to: Use Both Entity Framework 6 and XPO in a Single Application). However, if you want to create an Object Space manually, use an overload of the XafApplication.CreateObjectSpace method that takes the objectType parameter.

The passed list is assigned to the XafApplication.ObjectSpaceProviders property.


When multiple Object Space Providers are registered in the XafApplication.ObjectSpaceProviders property, the ModuleUpdater.UpdateDatabaseAfterUpdateSchema method is executed multiple times, once for each registered Provider. In this method, before accessing an object of a particular type, check if the current Object Space supports this type using the IObjectSpace.CanInstantiate method.

XAF uses the first registered Object Space Provider for the following purposes:

Ensure that NonPersistentObjectSpaceProvider is not the first registered Provider in your application.

See Also