ObjectContext.RefreshAsync ObjectContext.RefreshAsync Method

Definition

Overloads

RefreshAsync(RefreshMode, IEnumerable) RefreshAsync(RefreshMode, IEnumerable)

Asynchronously updates a collection of objects in the object context with data from the database.

RefreshAsync(RefreshMode, Object) RefreshAsync(RefreshMode, Object)

Asynchronously updates an object in the object context with data from the database.

RefreshAsync(RefreshMode, IEnumerable, CancellationToken) RefreshAsync(RefreshMode, IEnumerable, CancellationToken)

Asynchronously updates a collection of objects in the object context with data from the database.

RefreshAsync(RefreshMode, Object, CancellationToken) RefreshAsync(RefreshMode, Object, CancellationToken)

Asynchronously updates an object in the object context with data from the database.

RefreshAsync(RefreshMode, IEnumerable) RefreshAsync(RefreshMode, IEnumerable)

Asynchronously updates a collection of objects in the object context with data from the database.

public System.Threading.Tasks.Task RefreshAsync (System.Data.Entity.Core.Objects.RefreshMode refreshMode, System.Collections.IEnumerable collection);
member this.RefreshAsync : System.Data.Entity.Core.Objects.RefreshMode * System.Collections.IEnumerable -> System.Threading.Tasks.Task

Parameters

refreshMode
RefreshMode RefreshMode

A RefreshMode value that indicates whether property changes in the object context are overwritten with property values from the database.

collection
IEnumerable IEnumerable

An IEnumerable collection of objects to refresh.

Returns

A task that represents the asynchronous operation.

Exceptions

collection is empty or an object is not attached to the context.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure

that any asynchronous operations have completed before calling another method on this context.

RefreshAsync(RefreshMode, Object) RefreshAsync(RefreshMode, Object)

Asynchronously updates an object in the object context with data from the database.

public System.Threading.Tasks.Task RefreshAsync (System.Data.Entity.Core.Objects.RefreshMode refreshMode, object entity);
member this.RefreshAsync : System.Data.Entity.Core.Objects.RefreshMode * obj -> System.Threading.Tasks.Task

Parameters

refreshMode
RefreshMode RefreshMode

A RefreshMode value that indicates whether property changes in the object context are overwritten with property values from the database.

entity
Object Object

The object to be refreshed.

Returns

A task that represents the asynchronous operation.

Exceptions

entity is not attached to the context.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure

that any asynchronous operations have completed before calling another method on this context.

RefreshAsync(RefreshMode, IEnumerable, CancellationToken) RefreshAsync(RefreshMode, IEnumerable, CancellationToken)

Asynchronously updates a collection of objects in the object context with data from the database.

public virtual System.Threading.Tasks.Task RefreshAsync (System.Data.Entity.Core.Objects.RefreshMode refreshMode, System.Collections.IEnumerable collection, System.Threading.CancellationToken cancellationToken);
abstract member RefreshAsync : System.Data.Entity.Core.Objects.RefreshMode * System.Collections.IEnumerable * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.RefreshAsync : System.Data.Entity.Core.Objects.RefreshMode * System.Collections.IEnumerable * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

refreshMode
RefreshMode RefreshMode

A RefreshMode value that indicates whether property changes in the object context are overwritten with property values from the database.

collection
IEnumerable IEnumerable

An IEnumerable collection of objects to refresh.

cancellationToken
CancellationToken CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation.

Exceptions

collection is empty or an object is not attached to the context.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure

that any asynchronous operations have completed before calling another method on this context.

RefreshAsync(RefreshMode, Object, CancellationToken) RefreshAsync(RefreshMode, Object, CancellationToken)

Asynchronously updates an object in the object context with data from the database.

public virtual System.Threading.Tasks.Task RefreshAsync (System.Data.Entity.Core.Objects.RefreshMode refreshMode, object entity, System.Threading.CancellationToken cancellationToken);
abstract member RefreshAsync : System.Data.Entity.Core.Objects.RefreshMode * obj * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.RefreshAsync : System.Data.Entity.Core.Objects.RefreshMode * obj * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

refreshMode
RefreshMode RefreshMode

A RefreshMode value that indicates whether property changes in the object context are overwritten with property values from the database.

entity
Object Object

The object to be refreshed.

cancellationToken
CancellationToken CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

A task that represents the asynchronous operation.

Exceptions

entity is not attached to the context.

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure

that any asynchronous operations have completed before calling another method on this context.

Applies to