Share via


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

IDocumentClient.DeleteConflictAsync 方法

定义

重载

DeleteConflictAsync(String, RequestOptions)

Conflict以异步操作的形式从 Azure Cosmos DB 服务中删除 。

DeleteConflictAsync(Uri, RequestOptions)

在 Azure Cosmos DB 服务中删除作为异步操作的冲突。

DeleteConflictAsync(String, RequestOptions)

Conflict以异步操作的形式从 Azure Cosmos DB 服务中删除 。

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

参数

conflictLink
String

要删除的 的链接 Conflict 。 例如 dbs/db_rid/colls/coll_rid/conflicts/

options
RequestOptions

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

返回

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

例外

如果未 conflictLink 设置 。

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

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

示例

//Delete a conflict using its selfLink property.
//To get the conflictLink you would have to query for the Conflict object, using CreateConflictQuery(), and then refer to its .SelfLink property
await client.DeleteConflictAsync(conflictLink);

另请参阅

适用于

DeleteConflictAsync(Uri, RequestOptions)

在 Azure Cosmos DB 服务中删除作为异步操作的冲突。

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

参数

conflictUri
Uri

要删除的冲突的 URI。

options
RequestOptions

(可选的) RequestOptions 请求的 。

返回

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

适用于