Share via


EntityEntry.GetDatabaseValuesAsync(CancellationToken) Metodo

Definizione

Consente di eseguire una query sul database per individuare copie dei valori dell'entità rilevata uguali a quelli attualmente presenti nel database. Se l'entità non viene trovata nel database, viene restituito Null.

public virtual System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.ChangeTracking.PropertyValues> GetDatabaseValuesAsync (System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.ChangeTracking.PropertyValues?> GetDatabaseValuesAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetDatabaseValuesAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.ChangeTracking.PropertyValues>
override this.GetDatabaseValuesAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.EntityFrameworkCore.ChangeTracking.PropertyValues>
Public Overridable Function GetDatabaseValuesAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of PropertyValues)

Parametri

cancellationToken
CancellationToken

Oggetto CancellationToken da osservare durante l'attesa del completamento dell'attività.

Restituisce

Attività che rappresenta l'operazione asincrona. Il risultato dell'attività contiene i valori dell'archivio o null se l'entità non esiste nel database.

Eccezioni

Commenti

Si noti che la modifica dei valori nel dizionario restituito non aggiornerà i valori nel database.

Non sono supportate più operazioni attive nella stessa istanza di contesto. Usare await per assicurarsi che tutte le operazioni asincrone siano state completate prima di chiamare un altro metodo in questo contesto.

Per altre informazioni ed esempi, vedere Accesso alle entità rilevate in EF Core .

Si applica a