DocumentClient.UpsertUserAsync Method

Definition

Overloads

UpsertUserAsync(String, User, RequestOptions)

Upserts a permission on a user object in the Azure DocumentDB database service as an asychronous operation.

UpsertUserAsync(Uri, User, RequestOptions)

Upserts a user as an asychronous operation in the Azure DocumentDB database service.

UpsertUserAsync(String, User, RequestOptions)

Upserts a permission on a user object in the Azure DocumentDB database service as an asychronous operation.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.User>> UpsertUserAsync (string databaseLink, Microsoft.Azure.Documents.User user, Microsoft.Azure.Documents.Client.RequestOptions options = null);
Parameters
databaseLink
String

The link of the database to upsert the user in. E.g. dbs/db_rid/

user
User

The User object to upsert.

options
RequestOptions

(Optional) The request options for the request.

Returns

A task object representing the service response for the asynchronous operation which contains the upserted User object.

Exceptions

If either databaseLink or user is not set.

Represents a consolidation of failures that occured during async processing. Look within InnerExceptions to find the actual exception(s)

This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a Document are:

StatusCodeReason for exception
400BadRequest - This means something was wrong with the request supplied.
403Forbidden - You have reached your quota of user objects for this database. Contact support to have this quota increased.
409Conflict - This means a User with an id matching the id you supplied already existed.

UpsertUserAsync(Uri, User, RequestOptions)

Upserts a user as an asychronous operation in the Azure DocumentDB database service.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.User>> UpsertUserAsync (Uri databaseUri, Microsoft.Azure.Documents.User user, Microsoft.Azure.Documents.Client.RequestOptions options = null);
Parameters
databaseUri
Uri

the URI of the database to upsert the user in.

user
User

the Microsoft.Azure.Documents.User object.

options
RequestOptions

The request options for the request.

Returns

The task object representing the service response for the asynchronous operation.