Class GlobalAzureDocumentDbConnectionCache
A cache manager for DocumentDB clients, databases and collections that is global.
Inheritance
Namespace: Cqrs.Azure.DocumentDb
Assembly: Cqrs.Azure.DocumentDb.dll
Syntax
public class GlobalAzureDocumentDbConnectionCache : object, IAzureDocumentDbConnectionCache
Properties
Cache
Gets the
Declaration
protected static IDictionary<string, object> Cache { get; }
Property Value
Type | Description |
---|---|
IDictionary<System.String, System.Object> |
Methods
SetClient(String, DocumentClient)
Sets the provided client
.
Declaration
public void SetClient(string key, DocumentClient client)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The name of the |
DocumentClient | client | The |
Implements
SetDatabase(String, Database)
Sets the provided database
.
Declaration
public void SetDatabase(string key, Database database)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The name of the |
Database | database | The |
Implements
SetDocumentCollection(String, DocumentCollection)
Sets the provided documentCollection
.
Declaration
public void SetDocumentCollection(string key, DocumentCollection documentCollection)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The name of the |
DocumentCollection | documentCollection | The |
Implements
TryGetClient(String, out DocumentClient)
Gets the
Declaration
public bool TryGetClient(string key, out DocumentClient client)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The name of the |
DocumentClient | client | If the |
Returns
Type | Description |
---|---|
System.Boolean | true if the |
Implements
TryGetDatabase(String, out Database)
Gets the
Declaration
public bool TryGetDatabase(string key, out Database database)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The name of the |
Database | database | If the |
Returns
Type | Description |
---|---|
System.Boolean | true if the |
Implements
TryGetDocumentCollection(String, out DocumentCollection)
Gets the
Declaration
public bool TryGetDocumentCollection(string key, out DocumentCollection documentCollection)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The name of the |
DocumentCollection | documentCollection | If the |
Returns
Type | Description |
---|---|
System.Boolean | true if the |