Share via


Metodo ObjectContext.RefreshAsync (RefreshMode, Object)

[Questa pagina è specifica della versione 6 di Entity Framework. La versione più recente è disponibile come pacchetto NuGet per "Entity Framework". Per ulteriori informazioni su Entity Framework, vedere la pagina msdn.com/data/ef.]

Aggiorna in modo asincrono un oggetto nel contesto dell'oggetto con i dati presenti nel database.

Spazio dei nomi:  System.Data.Entity.Core.Objects
Assembly:  EntityFramework (in EntityFramework.dll)

Sintassi

'Dichiarazione
Public Function RefreshAsync ( _
    refreshMode As RefreshMode, _
    entity As Object _
) As Task
'Utilizzo
Dim instance As ObjectContext 
Dim refreshMode As RefreshMode 
Dim entity As Object 
Dim returnValue As Task 

returnValue = instance.RefreshAsync(refreshMode, _
    entity)
public Task RefreshAsync(
    RefreshMode refreshMode,
    Object entity
)
public:
Task^ RefreshAsync(
    RefreshMode refreshMode, 
    Object^ entity
)
member RefreshAsync : 
        refreshMode:RefreshMode * 
        entity:Object -> Task
public function RefreshAsync(
    refreshMode : RefreshMode, 
    entity : Object
) : Task

Parametri

Valore restituito

Tipo: System.Threading.Tasks.Task
Attività che rappresenta l'operazione asincrona.

Eccezioni

Eccezione Condizione
ArgumentNullException

entity è Null.

ArgumentOutOfRangeException

refreshMode non è valido.

ArgumentException

entity non è collegato al contesto.

Note

Non è consentito eseguire più operazioni attive nella stessa istanza di contesto. Usare 'await' per assicurarsi che eventuali operazioni asincrone vengano completate prima di chiamare un altro metodo su questo contesto.

Vedere anche

Riferimento

ObjectContext Classe

Overload RefreshAsync

Spazio dei nomi System.Data.Entity.Core.Objects