Share via


DataContext.Refresh Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Include Protected Members
Include Inherited Members

Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members

Refreshes object state by using data in the database.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public methodSupported by Silverlight for Windows Phone Refresh(RefreshMode, IEnumerable) Refreshes a collection of entity objects according to the specified mode.
Public methodSupported by Silverlight for Windows Phone Refresh(RefreshMode, Object) Refreshes an entity object according to the specified mode.
Public methodSupported by Silverlight for Windows Phone Refresh(RefreshMode, array<Object[]) Refreshes an array of entity objects according to the specified mode.

Top

Remarks

This method is useful after an optimistic concurrency error to bring items into a state for another attempt. It updates the state of the primitive fields and properties on the objects.

NoteNote:

If an object is on the many side of a one-to-many relationship, the foreign key on the object will be set and the object pointer for the other side of the relationship will be set to the new value.

For information about using a local database in your Windows Phone application, see Local Database Overview for Windows Phone.