Compartilhar via


CosmosConflicts.ReadCurrentAsync<T> Método

Definição

Lê o item que originou o conflito.

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

Parâmetros de tipo

T

Parâmetros

conflict
ConflictProperties

O conflito para o qual queremos ler o item.

partitionKey
PartitionKey

A chave de partição do item.

cancellationToken
CancellationToken

(Opcional) CancellationToken que representa o cancelamento da solicitação.

Retornos

O estado atual do item associado ao conflito.

Exemplos

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

Aplica-se a

Confira também