Lingua

EntityEntry.ReloadAsync(CancellationToken) Metodo

Definizione

Ricarica l'entità dal database sovrascrivendo i valori delle proprietà con valori del database.

public virtual System.Threading.Tasks.Task ReloadAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member ReloadAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.ReloadAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function ReloadAsync (Optional cancellationToken As CancellationToken = Nothing) As Task

Parametri

cancellationToken
CancellationToken

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

Valori restituiti

Attività che rappresenta l'operazione asincrona.

Eccezioni

Se l'oggetto CancellationToken viene annullato.

Commenti

L'entità Unchanged sarà nello stato dopo aver chiamato questo metodo, a meno che l'entità non esista nel database, nel qual caso l'entità sarà Detached. Infine, chiamare Ricarica su un'entità Added che non esiste nel database è un no-op. Si noti, tuttavia, che un'entità Aggiunta potrebbe non avere ancora creato il valore della chiave permanente.

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

Si applica a