Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ObjectContext::Refresh Method

Entity Framework 6.0
 

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.

Return to top

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.

Return to top

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.

Return to top
Show: