你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

DocumentClient.DeleteTriggerAsync 方法

定义

重载

DeleteTriggerAsync(String, RequestOptions)

Trigger从 Azure Cosmos DB 服务中删除 作为异步操作。

DeleteTriggerAsync(Uri, RequestOptions)

从 Azure Cosmos DB 服务中删除作为异步操作的触发器。

DeleteTriggerAsync(String, RequestOptions)

Trigger从 Azure Cosmos DB 服务中删除 作为异步操作。

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))

参数

triggerLink
String

要删除的 的链接 Trigger 。 例如 dbs/db_rid/colls/col_rid/triggers/trigger_rid/

options
RequestOptions

(可选) 请求的请求选项。

返回

一个 System.Threading.TasksResourceResponse<TResource> ,它包含有关发出的请求的信息。

实现

例外

如果未 triggerLink 设置 。

此异常可以封装许多不同类型的错误。 若要确定特定错误,请始终查看 StatusCode 属性。 创建文档时可能会获取的一些常见代码包括:

StatusCode异常原因
404NotFound - 这意味着尝试删除的资源不存在。

示例

//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);

另请参阅

适用于

DeleteTriggerAsync(Uri, RequestOptions)

从 Azure Cosmos DB 服务中删除作为异步操作的触发器。

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))

参数

triggerUri
Uri

要删除的触发器的 URI。

options
RequestOptions

请求的请求选项。

返回

表示异步操作的服务响应的任务对象。

实现

适用于