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.v18.2.dll
Declaration
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.
Note
The InMemoryDataStore provider is designed primarily for testing and demo purposes. It is not intended to be used with large data sets.
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
XpoDefault.DataLayer = new SimpleDataLayer(new InMemoryDataStore());