IDocumentClient.DeleteUserAsync IDocumentClient.DeleteUserAsync IDocumentClient.DeleteUserAsync Method

Definition

Overloads

DeleteUserAsync(String, RequestOptions) DeleteUserAsync(String, RequestOptions) DeleteUserAsync(String, RequestOptions)

Delete a User from the Azure Cosmos DB service as an asynchronous operation.

DeleteUserAsync(Uri, RequestOptions) DeleteUserAsync(Uri, RequestOptions) DeleteUserAsync(Uri, RequestOptions)

Delete a user as an asynchronous operation in the Azure Cosmos DB service.

DeleteUserAsync(String, RequestOptions) DeleteUserAsync(String, RequestOptions) DeleteUserAsync(String, RequestOptions)

Delete a User from the Azure Cosmos DB service as an asynchronous operation.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.User>> DeleteUserAsync (string userLink, Microsoft.Azure.Documents.Client.RequestOptions options = null);
abstract member DeleteUserAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.User>>
Public Function DeleteUserAsync (userLink As String, Optional options As RequestOptions = null) As Task(Of ResourceResponse(Of User))

Parameters

userLink
String String String

The link of the User to delete. E.g. dbs/db_rid/users/user_rid/

options
RequestOptions RequestOptions RequestOptions

(Optional) The request options for the request.

Returns

A System.Threading.Tasks containing a ResourceResponse<TResource> which will contain information about the request issued.

Exceptions

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
404NotFound - This means the resource you tried to delete did not exist.

Examples


  //Delete a user using its selfLink property.
  //To get the userLink you would have to query for the User object, using CreateUserQuery(), and then refer to its .SelfLink property
  await client.DeleteUserAsync(userLink);
See also

DeleteUserAsync(Uri, RequestOptions) DeleteUserAsync(Uri, RequestOptions) DeleteUserAsync(Uri, RequestOptions)

Delete a user as an asynchronous operation in the Azure Cosmos DB service.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.User>> DeleteUserAsync (Uri userUri, Microsoft.Azure.Documents.Client.RequestOptions options = null);
abstract member DeleteUserAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.User>>
Public Function DeleteUserAsync (userUri As Uri, Optional options As RequestOptions = null) As Task(Of ResourceResponse(Of User))

Parameters

userUri
Uri Uri Uri

The URI of the user to delete.

options
RequestOptions RequestOptions RequestOptions

(Optional) The RequestOptions for the request.

Returns

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

Applies to