Container.DeleteItemAsync<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Delete a item from the Azure Cosmos service as an asynchronous operation.
public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ItemResponse<T>> DeleteItemAsync<T> (string id, Microsoft.Azure.Cosmos.PartitionKey partitionKey, Microsoft.Azure.Cosmos.ItemRequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DeleteItemAsync : string * Microsoft.Azure.Cosmos.PartitionKey * Microsoft.Azure.Cosmos.ItemRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ItemResponse<'T>>
Public MustOverride Function DeleteItemAsync(Of T) (id As String, partitionKey As PartitionKey, Optional requestOptions As ItemRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ItemResponse(Of T))
Type Parameters
- T
Parameters
- id
- String
The Cosmos item id
- partitionKey
- PartitionKey
The partition key for the item.
- requestOptions
- ItemRequestOptions
(Optional) The options for the item request.
- cancellationToken
- CancellationToken
(Optional) CancellationToken representing request cancellation.
Returns
Task<ItemResponse<T>>
A Task containing a ItemResponse<T> which will contain information about the request issued.
Examples
public class ToDoActivity{
public string id {get; set;}
public string status {get; set;}
}
ItemResponse item = await this.container.DeleteItemAsync<ToDoActivity>("id", new PartitionKey("partitionKey"));
Remarks
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Azure SDK for .NET