Skip to main content
.NET 6.0+

SimpleDataLayer(IDataStore) Constructor

Initializes a new instance of the SimpleDataLayer class with a specified data store provider and default metadata information.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public SimpleDataLayer(
    IDataStore provider
)

Parameters

Name Type Description
provider IDataStore

A IDataStore object which implements data store-specific functionality.

Remarks

The default metadata is obtained via the XpoDefault.GetDictionary method.

Example

This example demonstrates how to store persistent objects in RAM.

To use RAM as a data store, a InMemoryDataStore object is created and passed to the SimpleDataLayer object constructor. The created SimpleDataLayer object is assigned to the XpoDefault.DataLayer property and will be used by any Session object when a connection to a data store is to be established.

using DevExpress.Xpo;
using DevExpress.Xpo.DB;

XpoDefault.DataLayer = new SimpleDataLayer(new InMemoryDataStore());
See Also