Language

ObjectContext.ApplyCurrentValues<TEntity>(String, TEntity) メソッド

定義

指定されたオブジェクトから、同じキーを持つ ObjectContext 内のオブジェクトにスカラー値をコピーします。

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

型パラメーター

TEntity

オブジェクトのエンティティ型。

パラメーター

entitySetName
String

オブジェクトが属するエンティティ セットの名前。

currentEntity
TEntity

元のオブジェクトに適用するプロパティの更新があるデタッチされたオブジェクト。 currentEntity のエンティティ キーは、ObjectContextのエントリのEntityKey プロパティと一致する必要があります。

戻り値

TEntity

更新されたオブジェクト。

例外

entitySetName または current が null です。

entitySetName からのEntitySetが、オブジェクト EntityKeyのEntitySetと一致しないか、オブジェクトがObjectStateManagerに含まれていないか、Detached状態であるか、指定されたオブジェクトのエンティティ キーが無効です。

entitySetName は空の文字列です。

適用対象