Class AzureDocumentDbDataStore<TData>
A IDataStore<TData> that uses Azure DocumentDB (CosmosDB) for storage.
Inheritance
Namespace: Cqrs.Azure.DocumentDb.DataStores
Assembly: Cqrs.Azure.DocumentDb.dll
Syntax
public class AzureDocumentDbDataStore<TData> : object, IDataStore<TData>, IOrderedQueryable<TData>, IDisposable where TData : AzureDocumentDbEntity
Type Parameters
Name | Description |
---|---|
TData | The |
Constructors
AzureDocumentDbDataStore(ILogger, DocumentClient, Database, DocumentCollection, IOrderedQueryable<TData>, IAzureDocumentDbHelper)
Instantiates and Initialises a new instance of the AzureDocumentDbDataStore<TData> class.
Declaration
public AzureDocumentDbDataStore(ILogger logger, DocumentClient azureDocumentDbClient, Database azureDocumentDbDatabase, DocumentCollection azureDocumentDbCollection, IOrderedQueryable<TData> azureDocumentDbQuery, IAzureDocumentDbHelper azureDocumentDbHelper)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | |
DocumentClient | azureDocumentDbClient | |
Database | azureDocumentDbDatabase | |
DocumentCollection | azureDocumentDbCollection | |
IOrderedQueryable<TData> | azureDocumentDbQuery | |
IAzureDocumentDbHelper | azureDocumentDbHelper |
Properties
AzureDocumentDbClient
Gets or sets the
Declaration
protected DocumentClient AzureDocumentDbClient { get; }
Property Value
Type | Description |
---|---|
DocumentClient |
AzureDocumentDbCollection
Gets or sets the
Declaration
protected DocumentCollection AzureDocumentDbCollection { get; }
Property Value
Type | Description |
---|---|
DocumentCollection |
AzureDocumentDbDatabase
Gets or sets the
Declaration
protected Database AzureDocumentDbDatabase { get; }
Property Value
Type | Description |
---|---|
Database |
AzureDocumentDbHelper
Gets or sets the IAzureDocumentDbHelper
Declaration
protected IAzureDocumentDbHelper AzureDocumentDbHelper { get; }
Property Value
Type | Description |
---|---|
IAzureDocumentDbHelper |
AzureDocumentDbQuery
Gets or sets the
Declaration
protected IOrderedQueryable<TData> AzureDocumentDbQuery { get; }
Property Value
Type | Description |
---|---|
IOrderedQueryable<TData> |
ElementType
Gets the type of the element(s) that are returned when the expression tree associated with this instance of System.Linq.IQueryable is executed.
Declaration
public Type ElementType { get; }
Property Value
Type | Description |
---|---|
Type | A System.Type that represents the type of the element(s) that are returned when the expression tree associated with this object is executed. |
Expression
Gets the expression tree that is associated with the instance of System.Linq.IQueryable.
Declaration
public Expression Expression { get; }
Property Value
Type | Description |
---|---|
Expression | The System.Linq.Expressions.Expression that is associated with this instance of System.Linq.IQueryable. |
Logger
Gets or sets the
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
ILogger |
Provider
Gets the singleResultQuery provider that is associated with this data source.
Declaration
public IQueryProvider Provider { get; }
Property Value
Type | Description |
---|---|
IQueryProvider | The System.Linq.IQueryProvider that is associated with this data source. |
Methods
Add(TData)
Add the provided data
to the data store and persist the change.
Declaration
public void Add(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Implements
Add(IEnumerable<TData>)
Add the provided data
to the data store and persist the change.
Declaration
public void Add(IEnumerable<TData> data)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TData> | data |
AsEnumerable()
Returns the instance as an
Declaration
public IEnumerable<TData> AsEnumerable()
Returns
Type | Description |
---|---|
IEnumerable<TData> |
Destroy(TData)
Remove the provided data
(normally by Rsn) from the data store and persist the change.
Declaration
public void Destroy(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Implements
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<TData> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<TData> | A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection. |
Remove(TData)
Will mark the data
as logically (or soft) by setting IsLogicallyDeleted to true
Declaration
public void Remove(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |
Implements
RemoveAll()
Remove all contents (normally by use of a truncate operation) from the data store and persist the change.
Declaration
public void RemoveAll()
Implements
Update(TData)
Update the provided data
in the data store and persist the change.
Declaration
public void Update(TData data)
Parameters
Type | Name | Description |
---|---|---|
TData | data |