IDocumentWriter<TDocument>.DeleteDocumentAsync Method

Definition

Deletes a document associated with the id.

public:
 System::Threading::Tasks::Task<System::Cloud::DocumentDb::IDatabaseResponse<bool> ^> ^ DeleteDocumentAsync(System::Cloud::DocumentDb::RequestOptions<TDocument> ^ options, System::String ^ id, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<bool>> DeleteDocumentAsync(System.Cloud.DocumentDb.RequestOptions<TDocument> options, string id, System.Threading.CancellationToken cancellationToken);
abstract member DeleteDocumentAsync : System.Cloud.DocumentDb.RequestOptions<'Document> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<bool>>
Public Function DeleteDocumentAsync (options As RequestOptions(Of TDocument), id As String, cancellationToken As CancellationToken) As Task(Of IDatabaseResponse(Of Boolean))

Parameters

options
RequestOptions<TDocument>

The request options.

id
String

The id of the document to be deleted.

cancellationToken
CancellationToken

The token represents request cancellation.

Returns

A Task containing a IDatabaseResponse<T> that wraps the asynchronous operation result. Result of the operation is true when deletion succeed, false if failed.

Exceptions

Thrown when an error occurred on a client side. For example on a bad request, permissions error or client timeout.

Thrown when an error occurred on a database server side, including internal server error.

Thrown when a request failed but can be retried. This includes throttling and server not available cases.

A generic exception thrown in all other not covered above cases.

Applies to