Skip to main content
A newer version of this page is available. .

InMemoryDataStore Class

Stores persistent objects in memory. Intended for testing environment.

Namespace: DevExpress.Xpo.DB

Assembly: DevExpress.Xpo.v21.1.dll

Declaration

public class InMemoryDataStore :
    DataStoreBase,
    IDataStoreSchemaExplorer,
    IDataStoreSchemaExplorerSp

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());

The following code snippets (auto-collected from DevExpress Examples) contain references to the InMemoryDataStore class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
MarshalByRefObject
DevExpress.Xpo.DB.DataStoreSerializedBase
DataStoreBase
InMemoryDataStore
See Also