Class AzureDocumentDbHelper
A helper for Azure Document DB.
Inheritance
System.Object
AzureDocumentDbHelper
Namespace: Cqrs.Azure.DocumentDb
Assembly: Cqrs.Azure.DocumentDb.dll
Syntax
public class AzureDocumentDbHelper : object, IAzureDocumentDbHelper
Constructors
AzureDocumentDbHelper(ILogger, IAzureDocumentDbConnectionCache)
Instantiates a new instance of AzureDocumentDbHelper.
Declaration
public AzureDocumentDbHelper(ILogger logger, IAzureDocumentDbConnectionCache azureDocumentDbConnectionCache)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | |
IAzureDocumentDbConnectionCache | azureDocumentDbConnectionCache |
Properties
AzureDocumentDbConnectionCache
Gets the IAzureDocumentDbConnectionCache
Declaration
protected IAzureDocumentDbConnectionCache AzureDocumentDbConnectionCache { get; }
Property Value
Type | Description |
---|---|
IAzureDocumentDbConnectionCache |
Logger
Gets or sets the
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
ILogger |
Methods
CreateOrReadCollection(DocumentClient, Database, String, String[])
Gets a
Declaration
public Task<DocumentCollection> CreateOrReadCollection(DocumentClient client, Database database, string collectionName, string[] uniqiueIndexPropertyNames = null)
Parameters
Type | Name | Description |
---|---|---|
DocumentClient | client | The |
Database | database | The |
System.String | collectionName | The name of the collection to get. |
System.String[] | uniqiueIndexPropertyNames | Any unique properties the collection should enforce. |
Returns
Type | Description |
---|---|
Task<DocumentCollection> |
Implements
CreateOrReadDatabase(DocumentClient, String)
Gets a
Declaration
public Task<Database> CreateOrReadDatabase(DocumentClient client, string databaseName)
Parameters
Type | Name | Description |
---|---|---|
DocumentClient | client | The |
System.String | databaseName | The name of the database to get. |
Returns
Type | Description |
---|---|
Task<Database> |
Implements
ExecuteFaultTollerantFunction(Action)
Execute the provided func
in a fault tolerant way.
Declaration
public virtual void ExecuteFaultTollerantFunction(Action func)
Parameters
Type | Name | Description |
---|---|---|
Action | func | The |
Implements
ExecuteFaultTollerantFunction<T>(Func<T>)
Execute the provided func
in a fault tolerant way.
Declaration
public virtual T ExecuteFaultTollerantFunction<T>(Func<T> func)
Parameters
Type | Name | Description |
---|---|---|
Func<T> | func | The |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Implements
ProcessFaultTollerantExceptions(DocumentClientException)
Process the provided documentClientException
checking for operations that can be retired.
Declaration
protected virtual void ProcessFaultTollerantExceptions(DocumentClientException documentClientException)
Parameters
Type | Name | Description |
---|---|---|
DocumentClientException | documentClientException | The |