DocumentClient DocumentClient Constructors

Definition

Overloads

DocumentClient(Uri, IDictionary<String,String>, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, IDictionary<String,String>, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the Microsoft.Azure.Documents.Client.DocumentClient class using the specified Azure Cosmos DB service endpoint, a dictionary of resource tokens and a connection policy.

DocumentClient(Uri, IList<Permission>, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, IList<Permission>, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint for the Azure Cosmos DB service, a list of permission objects and a connection policy.

DocumentClient(Uri, SecureString, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, SecureString, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint, key, and connection policy for the Azure Cosmos DB service.

DocumentClient(Uri, String, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, String, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified service endpoint, an authorization key (or resource token) and a connection policy for the Azure Cosmos DB service.

DocumentClient(Uri, SecureString, ConnectionPolicy, Nullable<ConsistencyLevel>, JsonSerializerSettings) DocumentClient(Uri, SecureString, ConnectionPolicy, Nullable<ConsistencyLevel>, JsonSerializerSettings)

Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint, key, connection policy and a custom JsonSerializerSettings for the Azure Cosmos DB service.

DocumentClient(Uri, SecureString, JsonSerializerSettings, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, SecureString, JsonSerializerSettings, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint, key, connection policy and a custom JsonSerializerSettings for the Azure Cosmos DB service.

DocumentClient(Uri, String, ConnectionPolicy, Nullable<ConsistencyLevel>, JsonSerializerSettings) DocumentClient(Uri, String, ConnectionPolicy, Nullable<ConsistencyLevel>, JsonSerializerSettings)

Initializes a new instance of the DocumentClient class using the specified service endpoint, an authorization key (or resource token), a connection policy and a custom JsonSerializerSettings for the Azure Cosmos DB service.

DocumentClient(Uri, String, JsonSerializerSettings, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, String, JsonSerializerSettings, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified service endpoint, an authorization key (or resource token), a connection policy and a custom JsonSerializerSettings for the Azure Cosmos DB service.

DocumentClient(Uri, IDictionary<String,String>, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, IDictionary<String,String>, ConnectionPolicy, Nullable<ConsistencyLevel>)

Warning

This API is now obsolete.

Initializes a new instance of the Microsoft.Azure.Documents.Client.DocumentClient class using the specified Azure Cosmos DB service endpoint, a dictionary of resource tokens and a connection policy.

[System.Obsolete("Please use the constructor that takes a permission list or a resource token list.")]
public DocumentClient (Uri serviceEndpoint, System.Collections.Generic.IDictionary<string,string> resourceTokens, Microsoft.Azure.Documents.Client.ConnectionPolicy connectionPolicy = null, Nullable<Microsoft.Azure.Documents.ConsistencyLevel> desiredConsistencyLevel = null);
new Microsoft.Azure.Documents.Client.DocumentClient : Uri * System.Collections.Generic.IDictionary<string, string> * Microsoft.Azure.Documents.Client.ConnectionPolicy * Nullable<Microsoft.Azure.Documents.ConsistencyLevel> -> Microsoft.Azure.Documents.Client.DocumentClient
Parameters
serviceEndpoint
Uri Uri

The service endpoint to use to create the client.

resourceTokens
IDictionary<String,String>

A dictionary of resource ids and resource tokens.

connectionPolicy
ConnectionPolicy ConnectionPolicy

(Optional) The connection policy for the client.

desiredConsistencyLevel
Nullable<ConsistencyLevel>

(Optional) The default consistency policy for client operations.

Remarks

Using Direct connectivity, wherever possible, is recommended

See Also

DocumentClient(Uri, IList<Permission>, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, IList<Permission>, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint for the Azure Cosmos DB service, a list of permission objects and a connection policy.

public DocumentClient (Uri serviceEndpoint, System.Collections.Generic.IList<Microsoft.Azure.Documents.Permission> permissionFeed, Microsoft.Azure.Documents.Client.ConnectionPolicy connectionPolicy = null, Nullable<Microsoft.Azure.Documents.ConsistencyLevel> desiredConsistencyLevel = null);
new Microsoft.Azure.Documents.Client.DocumentClient : Uri * System.Collections.Generic.IList<Microsoft.Azure.Documents.Permission> * Microsoft.Azure.Documents.Client.ConnectionPolicy * Nullable<Microsoft.Azure.Documents.ConsistencyLevel> -> Microsoft.Azure.Documents.Client.DocumentClient
Parameters
serviceEndpoint
Uri Uri

The service endpoint to use to create the client.

permissionFeed
IList<Permission>

A list of Permission objects to use to create the client.

connectionPolicy
ConnectionPolicy ConnectionPolicy

(Optional) The ConnectionPolicy to use for this connection.

desiredConsistencyLevel
Nullable<ConsistencyLevel>

(Optional) The default consistency policy for client operations.

Exceptions

If permissionFeed is not supplied.

If permissionFeed is not a valid permission link.

Remarks

If no connectionPolicy is provided, then the default ConnectionPolicy will be used. Using Direct connectivity, wherever possible, is recommended.

See Also

DocumentClient(Uri, SecureString, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, SecureString, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint, key, and connection policy for the Azure Cosmos DB service.

public DocumentClient (Uri serviceEndpoint, System.Security.SecureString authKey, Microsoft.Azure.Documents.Client.ConnectionPolicy connectionPolicy = null, Nullable<Microsoft.Azure.Documents.ConsistencyLevel> desiredConsistencyLevel = null);
new Microsoft.Azure.Documents.Client.DocumentClient : Uri * System.Security.SecureString * Microsoft.Azure.Documents.Client.ConnectionPolicy * Nullable<Microsoft.Azure.Documents.ConsistencyLevel> -> Microsoft.Azure.Documents.Client.DocumentClient
Parameters
serviceEndpoint
Uri Uri

The service endpoint to use to create the client.

authKey
SecureString SecureString

The list of Permission objects to use to create the client.

connectionPolicy
ConnectionPolicy ConnectionPolicy

(Optional) The connection policy for the client. If none is passed, the default is used ConnectionPolicy

desiredConsistencyLevel
Nullable<ConsistencyLevel>

(Optional) This can be used to weaken the database account consistency level for read operations. If this is not set the database account consistency level will be used for all requests.

Remarks

The service endpoint and the authorization key can be obtained from the Azure Management Portal. The authKey used here is encrypted for privacy when being used, and deleted from computer memory when no longer needed

Using Direct connectivity, wherever possible, is recommended

See Also

DocumentClient(Uri, String, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, String, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified service endpoint, an authorization key (or resource token) and a connection policy for the Azure Cosmos DB service.

public DocumentClient (Uri serviceEndpoint, string authKeyOrResourceToken, Microsoft.Azure.Documents.Client.ConnectionPolicy connectionPolicy = null, Nullable<Microsoft.Azure.Documents.ConsistencyLevel> desiredConsistencyLevel = null);
new Microsoft.Azure.Documents.Client.DocumentClient : Uri * string * Microsoft.Azure.Documents.Client.ConnectionPolicy * Nullable<Microsoft.Azure.Documents.ConsistencyLevel> -> Microsoft.Azure.Documents.Client.DocumentClient
Parameters
serviceEndpoint
Uri Uri

The service endpoint to use to create the client.

authKeyOrResourceToken
String String

The authorization key or resource token to use to create the client.

connectionPolicy
ConnectionPolicy ConnectionPolicy

(Optional) The connection policy for the client.

desiredConsistencyLevel
Nullable<ConsistencyLevel>

(Optional) The default consistency policy for client operations.

Remarks

The service endpoint can be obtained from the Azure Management Portal. If you are connecting using one of the Master Keys, these can be obtained along with the endpoint from the Azure Management Portal If however you are connecting as a specific Azure Cosmos DB User, the value passed to authKeyOrResourceToken is the ResourceToken obtained from the permission feed for the user.

Using Direct connectivity, wherever possible, is recommended.

See Also

DocumentClient(Uri, SecureString, ConnectionPolicy, Nullable<ConsistencyLevel>, JsonSerializerSettings) DocumentClient(Uri, SecureString, ConnectionPolicy, Nullable<ConsistencyLevel>, JsonSerializerSettings)

Warning

This API is now obsolete.

Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint, key, connection policy and a custom JsonSerializerSettings for the Azure Cosmos DB service.

[System.Obsolete("Please use the constructor that takes JsonSerializerSettings as the third parameter.")]
public DocumentClient (Uri serviceEndpoint, System.Security.SecureString authKey, Microsoft.Azure.Documents.Client.ConnectionPolicy connectionPolicy, Nullable<Microsoft.Azure.Documents.ConsistencyLevel> desiredConsistencyLevel, Newtonsoft.Json.JsonSerializerSettings serializerSettings);
new Microsoft.Azure.Documents.Client.DocumentClient : Uri * System.Security.SecureString * Microsoft.Azure.Documents.Client.ConnectionPolicy * Nullable<Microsoft.Azure.Documents.ConsistencyLevel> * Newtonsoft.Json.JsonSerializerSettings -> Microsoft.Azure.Documents.Client.DocumentClient
Parameters
serviceEndpoint
Uri Uri

The service endpoint to use to create the client.

authKey
SecureString SecureString

The list of Permission objects to use to create the client.

connectionPolicy
ConnectionPolicy ConnectionPolicy

The connection policy for the client.

desiredConsistencyLevel
Nullable<ConsistencyLevel>

This can be used to weaken the database account consistency level for read operations. If this is not set the database account consistency level will be used for all requests.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings

The custom JsonSerializer settings to be used for serialization/derialization.

Remarks

The service endpoint and the authorization key can be obtained from the Azure Management Portal. The authKey used here is encrypted for privacy when being used, and deleted from computer memory when no longer needed

Using Direct connectivity, wherever possible, is recommended

See Also

DocumentClient(Uri, SecureString, JsonSerializerSettings, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, SecureString, JsonSerializerSettings, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified Azure Cosmos DB service endpoint, key, connection policy and a custom JsonSerializerSettings for the Azure Cosmos DB service.

public DocumentClient (Uri serviceEndpoint, System.Security.SecureString authKey, Newtonsoft.Json.JsonSerializerSettings serializerSettings, Microsoft.Azure.Documents.Client.ConnectionPolicy connectionPolicy = null, Nullable<Microsoft.Azure.Documents.ConsistencyLevel> desiredConsistencyLevel = null);
new Microsoft.Azure.Documents.Client.DocumentClient : Uri * System.Security.SecureString * Newtonsoft.Json.JsonSerializerSettings * Microsoft.Azure.Documents.Client.ConnectionPolicy * Nullable<Microsoft.Azure.Documents.ConsistencyLevel> -> Microsoft.Azure.Documents.Client.DocumentClient
Parameters
serviceEndpoint
Uri Uri

The service endpoint to use to create the client.

authKey
SecureString SecureString

The list of Permission objects to use to create the client.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings

The custom JsonSerializer settings to be used for serialization/derialization.

connectionPolicy
ConnectionPolicy ConnectionPolicy

(Optional) The connection policy for the client. If none is passed, the default is used ConnectionPolicy

desiredConsistencyLevel
Nullable<ConsistencyLevel>

(Optional) This can be used to weaken the database account consistency level for read operations. If this is not set the database account consistency level will be used for all requests.

Remarks

The service endpoint and the authorization key can be obtained from the Azure Management Portal. The authKey used here is encrypted for privacy when being used, and deleted from computer memory when no longer needed

Using Direct connectivity, wherever possible, is recommended

See Also

DocumentClient(Uri, String, ConnectionPolicy, Nullable<ConsistencyLevel>, JsonSerializerSettings) DocumentClient(Uri, String, ConnectionPolicy, Nullable<ConsistencyLevel>, JsonSerializerSettings)

Warning

This API is now obsolete.

Initializes a new instance of the DocumentClient class using the specified service endpoint, an authorization key (or resource token), a connection policy and a custom JsonSerializerSettings for the Azure Cosmos DB service.

[System.Obsolete("Please use the constructor that takes JsonSerializerSettings as the third parameter.")]
public DocumentClient (Uri serviceEndpoint, string authKeyOrResourceToken, Microsoft.Azure.Documents.Client.ConnectionPolicy connectionPolicy, Nullable<Microsoft.Azure.Documents.ConsistencyLevel> desiredConsistencyLevel, Newtonsoft.Json.JsonSerializerSettings serializerSettings);
new Microsoft.Azure.Documents.Client.DocumentClient : Uri * string * Microsoft.Azure.Documents.Client.ConnectionPolicy * Nullable<Microsoft.Azure.Documents.ConsistencyLevel> * Newtonsoft.Json.JsonSerializerSettings -> Microsoft.Azure.Documents.Client.DocumentClient
Parameters
serviceEndpoint
Uri Uri

The service endpoint to use to create the client.

authKeyOrResourceToken
String String

The authorization key or resource token to use to create the client.

connectionPolicy
ConnectionPolicy ConnectionPolicy

The connection policy for the client.

desiredConsistencyLevel
Nullable<ConsistencyLevel>

The default consistency policy for client operations.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings

The custom JsonSerializer settings to be used for serialization/derialization.

Remarks

The service endpoint can be obtained from the Azure Management Portal. If you are connecting using one of the Master Keys, these can be obtained along with the endpoint from the Azure Management Portal If however you are connecting as a specific Azure Cosmos DB User, the value passed to authKeyOrResourceToken is the ResourceToken obtained from the permission feed for the user.

Using Direct connectivity, wherever possible, is recommended.

See Also

DocumentClient(Uri, String, JsonSerializerSettings, ConnectionPolicy, Nullable<ConsistencyLevel>) DocumentClient(Uri, String, JsonSerializerSettings, ConnectionPolicy, Nullable<ConsistencyLevel>)

Initializes a new instance of the DocumentClient class using the specified service endpoint, an authorization key (or resource token), a connection policy and a custom JsonSerializerSettings for the Azure Cosmos DB service.

public DocumentClient (Uri serviceEndpoint, string authKeyOrResourceToken, Newtonsoft.Json.JsonSerializerSettings serializerSettings, Microsoft.Azure.Documents.Client.ConnectionPolicy connectionPolicy = null, Nullable<Microsoft.Azure.Documents.ConsistencyLevel> desiredConsistencyLevel = null);
new Microsoft.Azure.Documents.Client.DocumentClient : Uri * string * Newtonsoft.Json.JsonSerializerSettings * Microsoft.Azure.Documents.Client.ConnectionPolicy * Nullable<Microsoft.Azure.Documents.ConsistencyLevel> -> Microsoft.Azure.Documents.Client.DocumentClient
Parameters
serviceEndpoint
Uri Uri

The service endpoint to use to create the client.

authKeyOrResourceToken
String String

The authorization key or resource token to use to create the client.

serializerSettings
Newtonsoft.Json.JsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings

The custom JsonSerializer settings to be used for serialization/derialization.

connectionPolicy
ConnectionPolicy ConnectionPolicy

(Optional) The connection policy for the client.

desiredConsistencyLevel
Nullable<ConsistencyLevel>

(Optional) The default consistency policy for client operations.

Remarks

The service endpoint can be obtained from the Azure Management Portal. If you are connecting using one of the Master Keys, these can be obtained along with the endpoint from the Azure Management Portal If however you are connecting as a specific Azure Cosmos DB User, the value passed to authKeyOrResourceToken is the ResourceToken obtained from the permission feed for the user.

Using Direct connectivity, wherever possible, is recommended.

See Also

Applies to