Table of Contents

Class SimpleDataLayer

Namespace
DevExpress.Xpo
Assembly
DevExpress.Xpo.v24.1.dll

Implements a data layer that enables the object metadata to be modified at runtime.

public class SimpleDataLayer : BaseDataLayer, ICommandChannel, ICommandChannelAsync, IDataLayerForTests, IDataLayerAsync, IDataLayer, IDisposable, IDataLayerProvider, IXPDictionaryProvider
Inheritance
SimpleDataLayer
Implements
ICommandChannel
ICommandChannelAsync
Inherited Members

Constructors

SimpleDataLayer(IDataStore)

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

public SimpleDataLayer(IDataStore provider)

Parameters

provider IDataStore

A DevExpress.Xpo.DB.IDataStore object which implements data store-specific functionality.

SimpleDataLayer(XPDictionary, IDataStore)

Initializes a new instance of the SimpleDataLayer class with the specified DevExpress.Xpo.DB.IDataStore object and metadata information.

public SimpleDataLayer(XPDictionary dictionary, IDataStore provider)

Parameters

dictionary XPDictionary

An XPDictionary object that specifies the metadata.

provider IDataStore

A DevExpress.Xpo.DB.IDataStore object which implements data-specific functionality.

Properties

Connection

A IDbConnection object that specifies the connection to the data store if it allows commands to be created.

[Browsable(false)]
public override IDbConnection Connection { get; }

Property Value

IDbConnection

A IDbConnection object that specifies the connection to the data store if it allows commands to be created.

SuppressReentrancyAndThreadSafetyCheck

Disables the thread safety diagnostic function.

[Obsolete("Reentrancy and thread safety check suppressed")]
public static bool SuppressReentrancyAndThreadSafetyCheck { get; set; }

Property Value

bool

true if the thread safety diagnostic function is disabled; otherwise false (default value is false).

Methods

ClearDatabase()

This member supports the internal infrastructure and is not intended to be used directly from your code.

public void ClearDatabase()

CreateCommand()

Creates a command if the data store allows commands to be created.

public override IDbCommand CreateCommand()

Returns

IDbCommand

A IDbCommand command that is executed when connected to the data store; null if the data store doesn’t allow commands to be created.

ModifyData(params ModificationStatement[])

Updates data in a data store using the specified modification statements.

public override ModificationResult ModifyData(params ModificationStatement[] dmlStatements)

Parameters

dmlStatements ModificationStatement[]

An array of data modification statements.

Returns

ModificationResult

The result of the data modifications.

ModifyDataAsync(CancellationToken, params ModificationStatement[])

public override Task<ModificationResult> ModifyDataAsync(CancellationToken cancellationToken, params ModificationStatement[] dmlStatements)

Parameters

cancellationToken CancellationToken
dmlStatements ModificationStatement[]

Returns

Task<ModificationResult>

OnClassInfoChanged(object, ClassInfoEventArgs)

protected override void OnClassInfoChanged(object sender, ClassInfoEventArgs e)

Parameters

sender object
e ClassInfoEventArgs

SelectData(params SelectStatement[])

Fetches data from a data store using the specified query statements.

public override SelectedData SelectData(params SelectStatement[] selects)

Parameters

selects SelectStatement[]

An array of statements to obtain data from the data store.

Returns

SelectedData

Data retrieved from the data store.

SelectDataAsync(CancellationToken, params SelectStatement[])

public override Task<SelectedData> SelectDataAsync(CancellationToken cancellationToken, params SelectStatement[] selects)

Parameters

cancellationToken CancellationToken
selects SelectStatement[]

Returns

Task<SelectedData>

UpdateSchema(bool, params XPClassInfo[])

Updates a data store’s schema according to the specified class descriptions.

public override UpdateSchemaResult UpdateSchema(bool doNotCreate, params XPClassInfo[] types)

Parameters

doNotCreate bool

true if the schema should not be created when the table that corresponds to the first item in the types array doesn’t exist in the storage.

types XPClassInfo[]

An array of XPClassInfo objects that specify object metadata for which the schema should be created in the data store.

Returns

UpdateSchemaResult

A DevExpress.Xpo.DB.UpdateSchemaResult value that specifies the result of the update operation.

UpdateSchemaAsync(CancellationToken, bool, params XPClassInfo[])

Asynchronously updates a data store’s schema according to the specified class descriptions.

public override Task<UpdateSchemaResult> UpdateSchemaAsync(CancellationToken cancellationToken, bool doNotCreate, params XPClassInfo[] types)

Parameters

cancellationToken CancellationToken

A CancellationToken object that delivers a cancellation notice to the running operation.

doNotCreate bool

true if the schema should not be created when the table that corresponds to the first item in the types array doesn’t exist in the storage.

types XPClassInfo[]

An array of XPClassInfo objects that specify object metadata for which the schema should be created in the data store.

Returns

Task<UpdateSchemaResult>

A Task<TResult> that returns an DevExpress.Xpo.DB.UpdateSchemaResult enumeration value which specifies the result of the update operation.