Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

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)
public abstract void ApplyOriginalValues(
	Object originalEntity
)

Parameters

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

When original is null.

InvalidOperationException

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

-or-

When the ObjectStateEntry is an EntityKey entry.

-or-

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

-or-

The object is in either an Added or Detached state.

-or-

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.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.