ObjectContext.Refresh Method

Definition

Overloads

Refresh(RefreshMode, IEnumerable)

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

Refresh(RefreshMode, Object)

Updates an object in the object context with data from the database.

Refresh(RefreshMode, IEnumerable)

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

public virtual void Refresh (System.Data.Entity.Core.Objects.RefreshMode refreshMode, System.Collections.IEnumerable collection);
abstract member Refresh : System.Data.Entity.Core.Objects.RefreshMode * System.Collections.IEnumerable -> unit
override this.Refresh : System.Data.Entity.Core.Objects.RefreshMode * System.Collections.IEnumerable -> unit

Parameters

refreshMode
RefreshMode

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

collection
IEnumerable

An IEnumerable collection of objects to refresh.

Exceptions

collection is null.

refreshMode is not valid.

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

Applies to

Refresh(RefreshMode, Object)

Updates an object in the object context with data from the database.

public virtual void Refresh (System.Data.Entity.Core.Objects.RefreshMode refreshMode, object entity);
abstract member Refresh : System.Data.Entity.Core.Objects.RefreshMode * obj -> unit
override this.Refresh : System.Data.Entity.Core.Objects.RefreshMode * obj -> unit

Parameters

refreshMode
RefreshMode

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

entity
Object

The object to be refreshed.

Exceptions

entity is null.

refreshMode is not valid.

entity is not attached to the context.

Applies to