CosmosConflicts.ReadCurrentAsync<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.
Reads the item that originated the conflict.
public abstract System.Threading.Tasks.Task<Azure.Cosmos.ItemResponse<T>> ReadCurrentAsync<T> (Azure.Cosmos.ConflictProperties conflict, Azure.Cosmos.PartitionKey partitionKey, System.Threading.CancellationToken cancellationToken = default);
abstract member ReadCurrentAsync : Azure.Cosmos.ConflictProperties * Azure.Cosmos.PartitionKey * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Cosmos.ItemResponse<'T>>
Public MustOverride Function ReadCurrentAsync(Of T) (conflict As ConflictProperties, partitionKey As PartitionKey, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ItemResponse(Of T))
Type Parameters
- T
Parameters
- conflict
- ConflictProperties
The conflict for which we want to read the item.
- partitionKey
- PartitionKey
The partition key for the item.
- cancellationToken
- CancellationToken
(Optional) CancellationToken representing request cancellation.
Returns
Task<ItemResponse<T>>
The current state of the item associated with the conflict.
Examples
await foreach(ConflictProperties item in conflicts.GetConflictsAsync())
{
MyClass intendedChanges = conflicts.ReadConflictContent<MyClass>(item);
ItemResponse<MyClass> currentState = await conflicts.ReadCurrentAsync<MyClass>(intendedChanges.MyPartitionKey, item);
}
Applies to
See also
Współpracuj z nami w serwisie GitHub
Źródło tej zawartości można znaleźć w witrynie GitHub, gdzie można również tworzyć i przeglądać problemy i żądania ściągnięcia. Więcej informacji znajdziesz w naszym przewodniku dla współtwórców.
Azure SDK for .NET