Class ThreadSafeDataLayer
- Namespace
- DevExpress.Xpo
- Assembly
- DevExpress.Xpo.v24.1.dll
Implements a data layer that allows multiple threads to access data in a data store at the same time.
public class ThreadSafeDataLayer : BaseDataLayer, ICommandChannel, IDataLayerAsync, IDataLayer, IDisposable, IDataLayerProvider, IXPDictionaryProvider, ICommandChannelAsync
- Inheritance
-
ThreadSafeDataLayer
- Implements
-
ICommandChannelICommandChannelAsync
- Inherited Members
Constructors
ThreadSafeDataLayer(IDataStore)
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(IDataStore provider)
Parameters
provider
IDataStore
ThreadSafeDataLayer(IDataStore, IEnumerable<Assembly>)
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(IDataStore provider, IEnumerable<Assembly> assemblies)
Parameters
provider
IDataStoreassemblies
IEnumerable<Assembly>
ThreadSafeDataLayer(IDataStore, IEnumerable<Type>)
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(IDataStore provider, IEnumerable<Type> types)
Parameters
provider
IDataStoretypes
IEnumerable<Type>
ThreadSafeDataLayer(IDataStore, params Assembly[])
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(IDataStore provider, params Assembly[] assemblies)
Parameters
provider
IDataStoreassemblies
Assembly[]
ThreadSafeDataLayer(IDataStore, params Type[])
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(IDataStore provider, params Type[] types)
Parameters
provider
IDataStoretypes
Type[]
ThreadSafeDataLayer(XPDictionary, IDataStore)
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(XPDictionary dictionary, IDataStore provider)
Parameters
dictionary
XPDictionaryprovider
IDataStore
ThreadSafeDataLayer(XPDictionary, IDataStore, Action<XPDictionary>)
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(XPDictionary dictionary, IDataStore provider, Action<XPDictionary> dictionaryInit)
Parameters
dictionary
XPDictionaryprovider
IDataStoredictionaryInit
Action<XPDictionary>
ThreadSafeDataLayer(XPDictionary, IDataStore, IEnumerable<Assembly>)
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(XPDictionary dictionary, IDataStore provider, IEnumerable<Assembly> assemblies)
Parameters
dictionary
XPDictionaryprovider
IDataStoreassemblies
IEnumerable<Assembly>
ThreadSafeDataLayer(XPDictionary, IDataStore, IEnumerable<Type>)
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(XPDictionary dictionary, IDataStore provider, IEnumerable<Type> types)
Parameters
dictionary
XPDictionaryprovider
IDataStoretypes
IEnumerable<Type>
ThreadSafeDataLayer(XPDictionary, IDataStore, params Assembly[])
Initializes a new instance of the ThreadSafeDataLayer class.
public ThreadSafeDataLayer(XPDictionary dictionary, IDataStore provider, params Assembly[] assemblies)
Parameters
dictionary
XPDictionaryAn XPDictionary object that specifies the metadata.
provider
IDataStoreA DevExpress.Xpo.DB.IDataStore object which implements data-specific functionality.
assemblies
Assembly[]An array of persistent object assemblies.
ThreadSafeDataLayer(XPDictionary, IDataStore, params Type[])
Initializes a new instance of the ThreadSafeDataLayer class with specified settings.
public ThreadSafeDataLayer(XPDictionary dictionary, IDataStore provider, params Type[] types)
Parameters
dictionary
XPDictionaryprovider
IDataStoretypes
Type[]
Properties
Connection
This property always returns null (Nothing in Visual Basic).
[Browsable(false)]
public override IDbConnection Connection { get; }
Property Value
- IDbConnection
Always null (Nothing in Visual Basic).
Methods
BeforeClassInfoSubscribe()
protected override void BeforeClassInfoSubscribe()
CreateCommand()
Returns null because ThreadSafeDataLayer does not allow commands to be created manually.
public override IDbCommand CreateCommand()
Returns
- IDbCommand
Always null (Nothing in Visual Basic).
Do(string, object)
protected override object Do(string command, object args)
Parameters
Returns
DoAsync(string, object, CancellationToken)
protected override Task<object> DoAsync(string command, object args, CancellationToken cancellationToken = default)
Parameters
command
stringargs
objectcancellationToken
CancellationToken
Returns
InitializeDictionary(XPDictionary)
public static void InitializeDictionary(XPDictionary dictionary)
Parameters
dictionary
XPDictionary
InitializeDictionary(XPDictionary, IEnumerable<Assembly>)
public static void InitializeDictionary(XPDictionary dictionary, IEnumerable<Assembly> assemblies)
Parameters
dictionary
XPDictionaryassemblies
IEnumerable<Assembly>
InitializeDictionary(XPDictionary, IEnumerable<Type>)
public static void InitializeDictionary(XPDictionary dictionary, IEnumerable<Type> types)
Parameters
dictionary
XPDictionarytypes
IEnumerable<Type>
InitializeDictionary(XPDictionary, params Assembly[])
public static void InitializeDictionary(XPDictionary dictionary, params Assembly[] assemblies)
Parameters
dictionary
XPDictionaryassemblies
Assembly[]
InitializeDictionary(XPDictionary, params Type[])
public static void InitializeDictionary(XPDictionary dictionary, params Type[] types)
Parameters
dictionary
XPDictionarytypes
Type[]
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
CancellationTokendmlStatements
ModificationStatement[]
Returns
- Task<ModificationResult>
OnClassInfoChanged(object, ClassInfoEventArgs)
protected override void OnClassInfoChanged(object sender, ClassInfoEventArgs e)
Parameters
sender
objecte
ClassInfoEventArgs
PrepareDataStore(IDataStore)
public static void PrepareDataStore(IDataStore dataStore)
Parameters
dataStore
IDataStore
PrepareDataStore(IDataStore, XPDictionary)
public static void PrepareDataStore(IDataStore dataStore, XPDictionary dictionary)
Parameters
dataStore
IDataStoredictionary
XPDictionary
PrepareDataStore(IDataStore, XPDictionary, params XPClassInfo[])
public static void PrepareDataStore(IDataStore dataStore, XPDictionary dictionary, params XPClassInfo[] types)
Parameters
dataStore
IDataStoredictionary
XPDictionarytypes
XPClassInfo[]
PrepareDataStore(IDataStore, XPDictionary, IEnumerable<XPClassInfo>)
public static void PrepareDataStore(IDataStore dataStore, XPDictionary dictionary, IEnumerable<XPClassInfo> types)
Parameters
dataStore
IDataStoredictionary
XPDictionarytypes
IEnumerable<XPClassInfo>
PrepareDataStore(IDataStore, XPDictionary, IEnumerable<Assembly>)
public static void PrepareDataStore(IDataStore dataStore, XPDictionary dictionary, IEnumerable<Assembly> assemblies)
Parameters
dataStore
IDataStoredictionary
XPDictionaryassemblies
IEnumerable<Assembly>
PrepareDataStore(IDataStore, XPDictionary, IEnumerable<Type>)
public static void PrepareDataStore(IDataStore dataStore, XPDictionary dictionary, IEnumerable<Type> types)
Parameters
dataStore
IDataStoredictionary
XPDictionarytypes
IEnumerable<Type>
PrepareDataStore(IDataStore, XPDictionary, params Assembly[])
public static void PrepareDataStore(IDataStore dataStore, XPDictionary dictionary, params Assembly[] assemblies)
Parameters
dataStore
IDataStoredictionary
XPDictionaryassemblies
Assembly[]
PrepareDataStore(IDataStore, XPDictionary, params Type[])
public static void PrepareDataStore(IDataStore dataStore, XPDictionary dictionary, params Type[] types)
Parameters
dataStore
IDataStoredictionary
XPDictionarytypes
Type[]
PrepareDataStore(IDataStore, IEnumerable<Assembly>)
public static void PrepareDataStore(IDataStore dataStore, IEnumerable<Assembly> assemblies)
Parameters
dataStore
IDataStoreassemblies
IEnumerable<Assembly>
PrepareDataStore(IDataStore, IEnumerable<Type>)
public static void PrepareDataStore(IDataStore dataStore, IEnumerable<Type> types)
Parameters
dataStore
IDataStoretypes
IEnumerable<Type>
PrepareDataStore(IDataStore, params Assembly[])
public static void PrepareDataStore(IDataStore dataStore, params Assembly[] assemblies)
Parameters
dataStore
IDataStoreassemblies
Assembly[]
PrepareDataStore(IDataStore, params Type[])
public static void PrepareDataStore(IDataStore dataStore, params Type[] types)
Parameters
dataStore
IDataStoretypes
Type[]
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
The data retrieved from the data store.
SelectDataAsync(CancellationToken, params SelectStatement[])
public override Task<SelectedData> SelectDataAsync(CancellationToken cancellationToken, params SelectStatement[] selects)
Parameters
cancellationToken
CancellationTokenselects
SelectStatement[]
Returns
- Task<SelectedData>
UpdateSchema(bool, params XPClassInfo[])
Updates the storage schema according to the specified class descriptions.
public override UpdateSchemaResult UpdateSchema(bool doNotCreate, params XPClassInfo[] types)
Parameters
doNotCreate
booltrue 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 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 the storage schema according to the specified class descriptions.
public override Task<UpdateSchemaResult> UpdateSchemaAsync(CancellationToken cancellationToken, bool doNotCreate, params XPClassInfo[] types)
Parameters
cancellationToken
CancellationTokenA CancellationToken object that delivers a cancellation notice to the running operation.
doNotCreate
booltrue 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 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.