ObjectContext.Refresh Method

 

Refreshes cache data with store data for a specific entity.

Namespace:   System.Data.Entity.Core.Objects
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodRefresh(RefreshMode, IEnumerable)

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

System_CAPS_pubmethodRefresh(RefreshMode, Object)

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


ObjectContext.Refresh Method (RefreshMode, IEnumerable)

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

public virtual void Refresh(
	RefreshMode refreshMode,
	IEnumerable collection
)

Parameters

refreshMode
Type: System.Data.Entity.Core.Objects.RefreshMode

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

collection
Type: System.Collections.IEnumerable

An IEnumerable collection of objects to refresh.

Exception Condition
ArgumentNullException

collection is null.

ArgumentOutOfRangeException

refreshMode is not valid.

ArgumentException

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


ObjectContext.Refresh Method (RefreshMode, Object)

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

public virtual void Refresh(
	RefreshMode refreshMode,
	object entity
)

Parameters

refreshMode
Type: System.Data.Entity.Core.Objects.RefreshMode

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

entity
Type: System.Object

The object to be refreshed.

Exception Condition
ArgumentNullException

entity is null.

ArgumentOutOfRangeException

refreshMode is not valid.

ArgumentException

entity is not attached to the context.