Partager via


Conflicts.ReadCurrentAsync<T> Méthode

Définition

Lit l’élément à l’origine du conflit.

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

Paramètres de type

T

Paramètres

conflict
ConflictProperties

Conflit pour lequel nous voulons lire l’élément.

partitionKey
PartitionKey

Clé de partition de l’élément.

cancellationToken
CancellationToken

(Facultatif) CancellationToken représentant l’annulation de la demande.

Retours

État actuel de l’élément associé au conflit.

Exemples

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

S’applique à

Voir aussi