次の方法で共有


Conflicts.ReadCurrentAsync<T> メソッド

定義

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

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

型パラメーター

T

パラメーター

conflict
ConflictProperties

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

partitionKey
PartitionKey

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

cancellationToken
CancellationToken

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

戻り値

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

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

適用対象

こちらもご覧ください