Class InMemoryDataStore
- Namespace
- DevExpress.Xpo.DB
- Assembly
- DevExpress.Xpo.v24.1.dll
Stores persistent objects in memory. Intended for a testing environment and not for production purposes or large data sets.
public class InMemoryDataStore : DataStoreBase, IDataStoreSchemaExplorer, IDataStoreSchemaExplorerSp
- Inheritance
-
InMemoryDataStore
- Implements
-
IDataStoreSchemaExplorerIDataStoreSchemaExplorerSp
Constructors
InMemoryDataStore()
Initializes a new instance of the InMemoryDataStore class and sets the IDataStore.AutoCreateOption property to AutoCreateOption.DatabaseAndSchema.
public InMemoryDataStore()
InMemoryDataStore(AutoCreateOption)
Initializes a new instance of the InMemoryDataStore class with the specified settings.
public InMemoryDataStore(AutoCreateOption autoCreateOption)
Parameters
autoCreateOption
AutoCreateOptionAn DevExpress.Xpo.DB.AutoCreateOption value that specifies which operations should be performed when storage is accessed for the first time. This parameter is used to initialize the IDataStore.AutoCreateOption property.
InMemoryDataStore(AutoCreateOption, bool)
Initializes a new instance of the InMemoryDataStore class with the specified settings.
public InMemoryDataStore(AutoCreateOption autoCreateOption, bool caseSensitive)
Parameters
autoCreateOption
AutoCreateOptionAn DevExpress.Xpo.DB.AutoCreateOption value that specifies which operations should be performed when storage is accessed for the first time. This parameter is used to initialize the IDataStore.AutoCreateOption property.
caseSensitive
booltrue if case-sensitive comparisons should be performed for strings during expression evaluations or sorting; otherwise false.
InMemoryDataStore(InMemoryDataStore, AutoCreateOption)
Initializes a new instance of the InMemoryDataStore class using the underlying storage of a specific InMemoryDataStore.
public InMemoryDataStore(InMemoryDataStore originalStore, AutoCreateOption autoCreateOption)
Parameters
originalStore
InMemoryDataStoreAn InMemoryDataStore whose underlying storage the current InMemoryDataStore will use.
autoCreateOption
AutoCreateOptionAn DevExpress.Xpo.DB.AutoCreateOption value that specifies which operations should be performed when storage is accessed for the first time. This parameter is used to initialize the IDataStore.AutoCreateOption property.
Fields
XpoProviderTypeString
Gets the name of the current connection provider. This name is used internally when generating a connection string via the InMemoryDataStore.GetConnectionString method.
public const string XpoProviderTypeString = "InMemoryDataStore"
Field Value
Properties
CanCreateSchema
Gets whether the InMemoryDataStore object is allowed to create a schema in the associated DataSet.
[Browsable(false)]
public bool CanCreateSchema { get; }
Property Value
- bool
true if the IDataStore.AutoCreateOption property’s value contains the AutoCreateOption.DatabaseAndSchema or AutoCreateOption.SchemaOnly option.
CaseSensitive
Gets whether the InMemoryDataStore performs case-sensitive comparisons for strings during expression evaluations or sorting.
[Browsable(false)]
public bool CaseSensitive { get; }
Property Value
- bool
true if string comparisons are case-sensitive; otherwise, false.
Methods
BeginTransaction()
protected virtual void BeginTransaction()
CreateProviderFromString(string, AutoCreateOption, out IDisposable[])
This method supports the internal infrastructure and is not intended to be called directly from your code.
public static IDataStore CreateProviderFromString(string connectionString, AutoCreateOption autoCreateOption, out IDisposable[] objectsToDisposeOnDisconnect)
Parameters
connectionString
stringautoCreateOption
AutoCreateOptionobjectsToDisposeOnDisconnect
IDisposable[]
Returns
- IDataStore
DoCommit()
protected virtual void DoCommit()
DoRollback()
protected virtual void DoRollback()
GetConnectionString(string)
Returns a connection string that can be used to create an InMemoryDataStore instance.
public static string GetConnectionString(string path)
Parameters
path
stringA string value that specifies the name (including the path) of the XML document that includes both schema and data.
Returns
- string
A string containing the connection string to an InMemoryDataStore instance.
GetConnectionString(string, bool)
Returns a connection string that can be used to create an InMemoryDataStore instance.
public static string GetConnectionString(string path, bool readOnly)
Parameters
path
stringA string value that specifies the name (including the path) of the XML document that includes both schema and data.
readOnly
booltrue if the XML document isn’t allowed to be changed; otherwise, false.
Returns
- string
A string containing the connection string to an InMemoryDataStore instance.
GetConnectionStringInMemory(bool)
Returns a connection string that can be used to create an InMemoryDataStore instance that is not bound to an XML file.
public static string GetConnectionStringInMemory(bool caseSensitive)
Parameters
caseSensitive
booltrue if string comparisons during expression evaluations or sorting are case-sensitive; otherwise, false.
Returns
- string
A string containing the connection string to an InMemoryDataStore instance.
GetDataGrouped(SelectStatement)
protected SelectStatementResult GetDataGrouped(SelectStatement root)
Parameters
root
SelectStatement
Returns
- SelectStatementResult
GetDataNormal(SelectStatement)
protected SelectStatementResult GetDataNormal(SelectStatement root)
Parameters
root
SelectStatement
Returns
- SelectStatementResult
GetStorageTables(params string[])
Returns information that describes the structures of the specified tables.
public DBTable[] GetStorageTables(params string[] tables)
Parameters
tables
string[]An array of table names whose information should be retrieved.
Returns
- DBTable[]
An array of DevExpress.Xpo.DB.DBTable objects that describe the structures of the requested tables.
GetStorageTablesList(bool)
Returns a list of the available tables in the data store.
public string[] GetStorageTablesList(bool includeViews)
Parameters
includeViews
booltrue, to include available database views in the resulting array; otherwise, false.
Returns
- string[]
An array of the table names in the data store.
GetStoredProcedures()
Returns an array of stored procedures available within the data store.
public DBStoredProcedure[] GetStoredProcedures()
Returns
- DBStoredProcedure[]
An array containing available stored procedures.
GetTableSchema(string)
This member supports the internal infrastructure and is not intended to be used directly from your code.
public DBTable GetTableSchema(string tableName)
Parameters
tableName
string
Returns
- DBTable
ProcessClearDatabase()
protected override void ProcessClearDatabase()
ProcessModifyData(params ModificationStatement[])
protected override ModificationResult ProcessModifyData(params ModificationStatement[] dmlStatements)
Parameters
dmlStatements
ModificationStatement[]
Returns
- ModificationResult
ProcessModifyDataAsync(AsyncOperationIdentifier, CancellationToken, params ModificationStatement[])
protected override Task<ModificationResult> ProcessModifyDataAsync(AsyncOperationIdentifier asyncOperationId, CancellationToken cancellationToken, params ModificationStatement[] dmlStatements)
Parameters
asyncOperationId
AsyncOperationIdentifiercancellationToken
CancellationTokendmlStatements
ModificationStatement[]
Returns
- Task<ModificationResult>
ProcessSelectData(SelectStatement)
protected override SelectStatementResult ProcessSelectData(SelectStatement selects)
Parameters
selects
SelectStatement
Returns
- SelectStatementResult
ProcessSelectDataAsync(SelectStatement, AsyncOperationIdentifier, CancellationToken)
protected override Task<SelectStatementResult> ProcessSelectDataAsync(SelectStatement selects, AsyncOperationIdentifier asyncOperationId, CancellationToken cancellationToken)
Parameters
selects
SelectStatementasyncOperationId
AsyncOperationIdentifiercancellationToken
CancellationToken
Returns
- Task<SelectStatementResult>
ProcessUpdateSchema(bool, params DBTable[])
protected override UpdateSchemaResult ProcessUpdateSchema(bool skipIfFirstTableNotExists, params DBTable[] tables)
Parameters
skipIfFirstTableNotExists
booltables
DBTable[]
Returns
- UpdateSchemaResult
ProcessUpdateSchemaAsync(AsyncOperationIdentifier, CancellationToken, bool, DBTable[])
protected override Task<UpdateSchemaResult> ProcessUpdateSchemaAsync(AsyncOperationIdentifier asyncOperationId, CancellationToken cancellationToken, bool doNotCreateIfFirstTableNotExist, DBTable[] tables)
Parameters
asyncOperationId
AsyncOperationIdentifiercancellationToken
CancellationTokendoNotCreateIfFirstTableNotExist
booltables
DBTable[]
Returns
- Task<UpdateSchemaResult>
ReadFromInMemoryDataStore(InMemoryDataStore)
Copies the content from a specified InMemoryDataStore.
public void ReadFromInMemoryDataStore(InMemoryDataStore dataStore)
Parameters
dataStore
InMemoryDataStoreAn InMemoryDataStore object which specifies the source in-memory data store.
ReadXml(string)
Reads the data into the InMemoryDataStore from a specific file.
public void ReadXml(string fileName)
Parameters
fileName
stringThe name of the file to read data from.
ReadXml(XmlReader)
Reads the data into the InMemoryDataStore from a specific XmlReader.
public void ReadXml(XmlReader reader)
Parameters
reader
XmlReaderA System.Xml.XmlReader object to read data from.
Register()
Registers the provider for use with XPO.
public static void Register()
RegisterCustomAggregate(ICustomAggregate)
public void RegisterCustomAggregate(ICustomAggregate customAggregate)
Parameters
customAggregate
ICustomAggregate
RegisterCustomAggregates(ICollection<ICustomAggregate>)
public void RegisterCustomAggregates(ICollection<ICustomAggregate> customAggregates)
Parameters
customAggregates
ICollection<ICustomAggregate>
RegisterCustomFunctionOperator(ICustomFunctionOperator)
Registers a custom function operator.
public void RegisterCustomFunctionOperator(ICustomFunctionOperator customFunction)
Parameters
customFunction
ICustomFunctionOperatorAn DevExpress.Data.Filtering.ICustomFunctionOperator object which is a custom function operator to be registered.
RegisterCustomFunctionOperators(ICollection<ICustomFunctionOperator>)
Registers custom function operators.
public void RegisterCustomFunctionOperators(ICollection<ICustomFunctionOperator> customFunctions)
Parameters
customFunctions
ICollection<ICustomFunctionOperator>An ICollection<DevExpress.Data.Filtering.ICustomFunctionOperator> object which specifies the custom function operators to be registered.
WriteXml(string)
Writes the data contained in the InMemoryDataStore to the specified file.
public void WriteXml(string fileName)
Parameters
fileName
stringThe name of the file to which to write data.
WriteXml(XmlWriter)
Writes the data contained in the InMemoryDataStore to the specified XmlWriter.
public void WriteXml(XmlWriter writer)
Parameters
writer
XmlWriterA System.Xml.XmlWriter object to which to write data.