Conflicts.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<Microsoft.Azure.Cosmos.ItemResponse<T>> ReadCurrentAsync<T> (Microsoft.Azure.Cosmos.ConflictProperties conflict, Microsoft.Azure.Cosmos.PartitionKey partitionKey, System.Threading.CancellationToken cancellationToken = default);
abstract member ReadCurrentAsync : Microsoft.Azure.Cosmos.ConflictProperties * Microsoft.Azure.Cosmos.PartitionKey * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.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
using (FeedIterator<ConflictProperties> conflictIterator = conflicts.GetConflictQueryIterator())
{
while (conflictIterator.HasMoreResults)
{
foreach(ConflictProperties item in await conflictIterator.ReadNextAsync())
{
MyClass intendedChanges = conflicts.ReadConflictContent<MyClass>(item);
ItemResponse<MyClass> currentState = await conflicts.ReadCurrentAsync<MyClass>(item, intendedChanges.MyPartitionKey);
}
}
}
Applies to
See also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應