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
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
Azure SDK for .NET
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin