ObjectContext.ApplyCurrentValues(String, TEntity) ObjectContext.ApplyCurrentValues(String, TEntity) ObjectContext.ApplyCurrentValues(String, TEntity) Method

Definition

Copies the scalar values from the supplied object into the object in the ObjectContext that has the same key.

public virtual TEntity ApplyCurrentValues<TEntity> (string entitySetName, TEntity currentEntity) where TEntity : class;
abstract member ApplyCurrentValues : string * 'Entity -> 'Entity (requires 'Entity : null)
override this.ApplyCurrentValues : string * 'Entity -> 'Entity (requires 'Entity : null)
Public Overridable Function ApplyCurrentValues(Of TEntity As Class) (entitySetName As String, currentEntity As TEntity) As TEntity

Type Parameters

TEntity

The entity type of the object.

Parameters

entitySetName
String String String

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

currentEntity
TEntity TEntity TEntity

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

Returns

TEntity TEntity TEntity

The updated object.

Exceptions

The EntitySet from entitySetName does not match the EntitySet of the object EntityKey or the object is not in the ObjectStateManager or it is in a Detached state or the entity key of the supplied object is invalid.

Applies to