InMemoryDataStore Class
Stores persistent objects in memory. Intended for testing environment.
Namespace: DevExpress.Xpo.DB
Assembly: DevExpress.Xpo.v20.2.dll
NuGet Package: DevExpress.Xpo
NuGet Packages: DevExpress.WindowsDesktop.Xpo, DevExpress.Xpo
Declaration
Remarks
When a Session object uses the functionality of the InMemoryDataStore class, persistent objects will be stored to and loaded from RAM.
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());