Export (0) Print
Expand All

ObjectStateEntry.ApplyCurrentValues Method

Sets the current 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 ApplyCurrentValues(
	Object currentEntity
)

Parameters

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

ExceptionCondition
ArgumentNullException

When currentEntity 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, Deleted, or Detached state.

-or-

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

The ApplyCurrentValues method sets the CurrentValues property of the ObjectStateEntry instance to match the values of the supplied object.

The ApplyCurrentValues method is used to apply changes that were made to objects 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.

Community Additions

ADD
Show:
© 2014 Microsoft