Class CRUDTransaction
Represents an abstract base for CRUDTransactions that perform particular backend CRUD work in overriden classes
Inheritance
System.Object
CRUDTransaction
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Azos.dll
Syntax
public abstract class CRUDTransaction : DisposableObject, IDisposable, ICRUDOperations
Constructors
CRUDTransaction(ICRUDDataStoreImplementation, TransactionDisposeBehavior)
Declaration
protected CRUDTransaction(ICRUDDataStoreImplementation store, TransactionDisposeBehavior disposeBehavior = TransactionDisposeBehavior.CommitOnDispose)
Parameters
Fields
m_Store
Declaration
protected ICRUDDataStoreImplementation m_Store
Field Value
Properties
DataStore
References the store instance that started this transaction
Declaration
public ICRUDDataStore DataStore { get; }
Property Value
DisposeBehavior
Specifies how transaction should be finalized on dispose: comitted or rolledback if it is still open
Declaration
public TransactionDisposeBehavior DisposeBehavior { get; }
Property Value
Status
Returns current transaction status
Declaration
public TransactionStatus Status { get; }
Property Value
SupportsTrueAsynchrony
Returns true when backend supports true asynchronous operations, such as the ones that do not create extra threads/empty tasks
Declaration
public bool SupportsTrueAsynchrony { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
CheckOpenStatus(String)
Declaration
protected void CheckOpenStatus(string operation)
Parameters
Type |
Name |
Description |
System.String |
operation |
|
Commit()
Declaration
Delete(Doc, IDataStoreKey)
Declaration
public int Delete(Doc doc, IDataStoreKey key = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DeleteAsync(Doc, IDataStoreKey)
Declaration
public Task<int> DeleteAsync(Doc doc, IDataStoreKey key = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
Destructor()
Declaration
protected override void Destructor()
Overrides
DoCommit()
Declaration
protected abstract void DoCommit()
DoDelete(Doc, IDataStoreKey)
Declaration
protected abstract int DoDelete(Doc doc, IDataStoreKey key)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DoDeleteAsync(Doc, IDataStoreKey)
Declaration
protected abstract Task<int> DoDeleteAsync(Doc doc, IDataStoreKey key)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
DoExecuteWithoutFetch(Query[])
Declaration
protected abstract int DoExecuteWithoutFetch(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Int32 |
|
DoExecuteWithoutFetchAsync(Query[])
Declaration
protected abstract Task<int> DoExecuteWithoutFetchAsync(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
DoGetSchema(Query)
Declaration
protected abstract Schema DoGetSchema(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
DoGetSchemaAsync(Query)
Declaration
protected abstract Task<Schema> DoGetSchemaAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Schema> |
|
DoInsert(Doc, FieldFilterFunc)
Declaration
protected abstract int DoInsert(Doc doc, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DoInsertAsync(Doc, FieldFilterFunc)
Declaration
protected abstract Task<int> DoInsertAsync(Doc doc, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
DoLoad(Boolean, Query[])
Declaration
protected abstract List<RowsetBase> DoLoad(bool oneRow, params Query[] queries)
Parameters
Type |
Name |
Description |
System.Boolean |
oneRow |
|
Query[] |
queries |
|
Returns
Type |
Description |
System.Collections.Generic.List<RowsetBase> |
|
DoLoadAsync(Boolean, Query[])
Declaration
protected abstract Task<List<RowsetBase>> DoLoadAsync(bool oneRow, params Query[] queries)
Parameters
Type |
Name |
Description |
System.Boolean |
oneRow |
|
Query[] |
queries |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.List<RowsetBase>> |
|
DoOpenCursor(Query)
Declaration
protected abstract Cursor DoOpenCursor(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
DoOpenCursorAsync(Query)
Declaration
protected abstract Task<Cursor> DoOpenCursorAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Cursor> |
|
DoRollback()
Declaration
protected abstract void DoRollback()
DoSave(RowsetBase[])
Declaration
protected abstract int DoSave(params RowsetBase[] tables)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DoSaveAsync(RowsetBase[])
Declaration
protected abstract Task<int> DoSaveAsync(params RowsetBase[] tables)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
DoUpdate(Doc, IDataStoreKey, FieldFilterFunc)
Declaration
protected abstract int DoUpdate(Doc doc, IDataStoreKey key, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DoUpdateAsync(Doc, IDataStoreKey, FieldFilterFunc)
Declaration
protected abstract Task<int> DoUpdateAsync(Doc doc, IDataStoreKey key, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
DoUpsert(Doc, FieldFilterFunc)
Declaration
protected abstract int DoUpsert(Doc doc, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DoUpsertAsync(Doc, FieldFilterFunc)
Declaration
protected abstract Task<int> DoUpsertAsync(Doc doc, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
ExecuteWithoutFetch(Query[])
Declaration
public int ExecuteWithoutFetch(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteWithoutFetchAsync(Query[])
Declaration
public Task<int> ExecuteWithoutFetchAsync(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
GetSchema(Query)
Declaration
public Schema GetSchema(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
GetSchemaAsync(Query)
Declaration
public Task<Schema> GetSchemaAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Schema> |
|
Insert(Doc, FieldFilterFunc)
Declaration
public int Insert(Doc doc, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
InsertAsync(Doc, FieldFilterFunc)
Declaration
public Task<int> InsertAsync(Doc doc, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
Load(Query[])
Declaration
public List<RowsetBase> Load(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Collections.Generic.List<RowsetBase> |
|
LoadAsync(Query[])
Declaration
public Task<List<RowsetBase>> LoadAsync(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.List<RowsetBase>> |
|
LoadOneDoc(Query)
Declaration
public Doc LoadOneDoc(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
LoadOneDocAsync(Query)
Declaration
public Task<Doc> LoadOneDocAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Doc> |
|
LoadOneRowset(Query)
Declaration
public RowsetBase LoadOneRowset(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
LoadOneRowsetAsync(Query)
Declaration
public Task<RowsetBase> LoadOneRowsetAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<RowsetBase> |
|
OpenCursor(Query)
Declaration
public Cursor OpenCursor(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
OpenCursorAsync(Query)
Declaration
public Task<Cursor> OpenCursorAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Cursor> |
|
Rollback()
Declaration
Save(RowsetBase[])
Declaration
public int Save(params RowsetBase[] tables)
Parameters
Returns
Type |
Description |
System.Int32 |
|
SaveAsync(RowsetBase[])
Declaration
public Task<int> SaveAsync(params RowsetBase[] tables)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
Update(Doc, IDataStoreKey, FieldFilterFunc)
Declaration
public int Update(Doc doc, IDataStoreKey key = null, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
UpdateAsync(Doc, IDataStoreKey, FieldFilterFunc)
Declaration
public Task<int> UpdateAsync(Doc doc, IDataStoreKey key = null, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
Upsert(Doc, FieldFilterFunc)
Declaration
public int Upsert(Doc doc, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
UpsertAsync(Doc, FieldFilterFunc)
Declaration
public Task<int> UpsertAsync(Doc doc, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
Implements
System.IDisposable
Extension Methods