Back to Devexpress

NonPersistentObjectSpace Class

expressappframework-devexpress-dot-expressapp-49b06077.md

latest5.8 KB
Original Source

NonPersistentObjectSpace Class

An Object Space used to manage non-persistent objects.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public class NonPersistentObjectSpace :
    CompositeObjectSpace
vb
Public Class NonPersistentObjectSpace
    Inherits CompositeObjectSpace

Remarks

To supply non-persistent objects for NonPersistentObjectSpace, use the ObjectsGetting event that occurs when NonPersistentObjectSpace creates an object collection. You can find examples in the following topics:

To supply an object returned by the GetObject(Object) method, use the ObjectGetting event.

The New , Delete and Save Actions are available for non-persistent objects. To access all created, deleted and modified objects within NonPersistentObjectSpace, use the NonPersistentObjectSpace.ModifiedObjects property.

The IObjectSpaceLink.ObjectSpace property of non-persistent objects that support IObjectSpaceLink is initialized in these cases:

If an object from another Object Space passed to the GetObject method implements IObjectSpaceLink, and its ObjectSpace property is null, the current NonPersistentObjectSpace assigns a link to itself in this property. Similar behavior is implemented for objects returned by the GetObjects and CreateCollection methods using the NonPersistentObjectSpace.ObjectsGetting event.

Enable the Non-Persistent Object Space in Your Application

The Template Kit automatically registers the non-persistent Object Space Provider in the application. However, for projects created with older XAF versions, you need to register it manually. Call the DevExpress.ExpressApp.ApplicationBuilder.NonPersistentObjectSpaceProviderBuilderExtensions.AddNonPersistent method in the ObjectSpaceProviders property:

csharp
builder.ObjectSpaceProviders
    // ...
    .AddNonPersistent();
// ...

Note

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

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

Implements

IObjectSpace

Inheritance

Object BaseObjectSpace CompositeObjectSpace NonPersistentObjectSpace

See Also

NonPersistentObjectSpace Members

DevExpress.ExpressApp Namespace