次の方法で共有


CosmosConflicts.ReadCurrentAsync<T> メソッド

定義

競合の発生元のアイテムを読み取ります。

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))

型パラメーター

T

パラメーター

conflict
ConflictProperties

アイテムを読み取る競合。

partitionKey
PartitionKey

項目のパーティション キー。

cancellationToken
CancellationToken

(省略可能) CancellationToken 要求の取り消しを表します。

戻り値

競合に関連付けられているアイテムの現在の状態。

await foreach(ConflictProperties item in conflicts.GetConflictsAsync())
{
    MyClass intendedChanges = conflicts.ReadConflictContent<MyClass>(item);
    ItemResponse<MyClass> currentState = await conflicts.ReadCurrentAsync<MyClass>(intendedChanges.MyPartitionKey, item);
}

適用対象

こちらもご覧ください