Sdílet prostřednictvím


DocumentClient.DeleteTriggerAsync Method

Definition

Overloads

DeleteTriggerAsync(String, RequestOptions)

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

DeleteTriggerAsync(Uri, RequestOptions)

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

DeleteTriggerAsync(String, RequestOptions)

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

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Trigger>> DeleteTriggerAsync (string triggerLink, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeleteTriggerAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Trigger>>
override this.DeleteTriggerAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Trigger>>
Public Function DeleteTriggerAsync (triggerLink As String, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of Trigger))

Parameters

triggerLink
String

The link of the Trigger to delete. E.g. dbs/db_rid/colls/col_rid/triggers/trigger_rid/

options
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.

Implements

Exceptions

If triggerLink is not set.

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 trigger using its selfLink property.
//To get the triggerLink you would have to query for the Trigger, using CreateTriggerQuery(),  and then refer to its .SelfLink property
await client.DeleteTriggerAsync(triggerLink);

See also

Applies to

DeleteTriggerAsync(Uri, RequestOptions)

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

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Trigger>> DeleteTriggerAsync (Uri triggerUri, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeleteTriggerAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Trigger>>
override this.DeleteTriggerAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Trigger>>
Public Function DeleteTriggerAsync (triggerUri As Uri, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of Trigger))

Parameters

triggerUri
Uri

the URI of the trigger to delete.

options
RequestOptions

The request options for the request.

Returns

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

Implements

Applies to