This documentation is archived and is not being maintained.

ObjectStateEntry.ApplyOriginalValues Method

Sets the original values of the entry to match the property values of a supplied object.

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

abstract ApplyOriginalValues : 
        originalEntity:Object -> unit 


Type: System.Object
The detached object that has original values to apply to the object. original can also be the object's entity key.


When original is a null reference (Nothing in Visual Basic).


When the key of the supplied object does not match the EntityKey property of the ObjectStateEntry.


When the ObjectStateEntry is an EntityKey entry.


When the object is not in the [T:System.Data.Objects.ObjectStateManager.]


The object is in either an Added or Detached state.


The entity key of the supplied object is invalid or has property changes.

The ApplyOriginalValues method sets the OriginalValues of the ObjectStateEntry instance to match the values of the supplied object. The entity key of the supplied object must match the EntityKey property of an entry in the ObjectStateManager.

When changes are applied to the original values of an object in an Unchanged state, the EntityState is changed to Modified.

The ApplyOriginalValues method is used to set the original values of an object to the properties of an object outside the ObjectContext, such as detached objects that are received by a Web service.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.