DefaultDocumentDBConnection/IDocumentDBConnection
namespace: MvcControlsToolkit.Business.DocumentDB
The DefaultDocumentDBConnection
class represents a connection with a CosmosDB/DocumentDB database.
The class constructor is:
public DefaultDocumentDBConnection(string endpoint, string key, string databaseId,
ConnectionPolicy connectionPolicy = null,
ConsistencyLevel? consistencyLevel = null)
ConnectionPolicy connectionPolicy = null,
ConsistencyLevel? consistencyLevel = null)
Where:
- endpoint: string
- The Url of your CosmosDB resources
- key: string
- Your secret Key
- databaseId: string
- The name of the CosmosDB database
- connectionPolicy: ConnectionPolicy
- The definition of the default database connection policy
- consistencyLevel: ConsistencyLevel
- The default database consistency level
DefaultDocumentDBConnection
implements the IDocumentDBConnection
interface that has just two readonly properties:
- Client: DocumentClient
- The client needed to start any operation.
- DatabaseId: string
- The database name.