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::ApplyOriginalValues<TEntity> Method (String^, TEntity)

Entity Framework 6.0
 

Copies the scalar values from the supplied object into set of original values for the object in the ObjectContext that has the same key.

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

public:
generic<typename TEntity>
where TEntity : ref class
virtual TEntity ApplyOriginalValues(
	String^ entitySetName,
	TEntity originalEntity
)

Parameters

entitySetName
Type: System::String^

The name of the entity set to which the object belongs.

originalEntity
Type: TEntity

The detached object that has original values to apply to the object. The entity key of originalEntity must match the EntityKey property of an entry in the ObjectContext .

Return Value

Type: TEntity

The updated object.

Type Parameters

TEntity

The type of the entity object.

Exception Condition
ArgumentNullException

entitySetName or original is null.

InvalidOperationException

The EntitySet from entitySetName does not match the EntitySet of the object EntityKey or an ObjectStateEntry for the object cannot be found in the ObjectStateManager or the object is in an Added or a Detached state or the entity key of the supplied object is invalid or has property changes.

ArgumentException

entitySetName is an empty string.

Return to top
Show: