次の方法で共有


ObjectContext.ApplyPropertyChanges メソッド

[このページは、Entity Framework 6 に関するページです。最新バージョンは、'Entity Framework' NuGet パッケージとして入手できます。Entity Framework の詳細については、msdn.com/data/ef を参照してください。]

メモ: この API は、互換性のために残されています。

デタッチしたオブジェクトのプロパティの変更を、オブジェクト コンテキストに既にアタッチされているオブジェクトに適用します。

名前空間:  System.Data.Entity.Core.Objects
アセンブリ:  EntityFramework (EntityFramework.dll 内)

構文

'宣言
<ObsoleteAttribute("Use ApplyCurrentValues instead")> _
<BrowsableAttribute(False)> _
<EditorBrowsableAttribute(EditorBrowsableState.Never)> _
Public Overridable Sub ApplyPropertyChanges ( _
    entitySetName As String, _
    changed As Object _
)
'使用
Dim instance As ObjectContext 
Dim entitySetName As String 
Dim changed As Object

instance.ApplyPropertyChanges(entitySetName, _
    changed)
[ObsoleteAttribute("Use ApplyCurrentValues instead")]
[BrowsableAttribute(false)]
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
public virtual void ApplyPropertyChanges(
    string entitySetName,
    Object changed
)
[ObsoleteAttribute(L"Use ApplyCurrentValues instead")]
[BrowsableAttribute(false)]
[EditorBrowsableAttribute(EditorBrowsableState::Never)]
public:
virtual void ApplyPropertyChanges(
    String^ entitySetName, 
    Object^ changed
)
[<ObsoleteAttribute("Use ApplyCurrentValues instead")>]
[<BrowsableAttribute(false)>]
[<EditorBrowsableAttribute(EditorBrowsableState.Never)>]
abstract ApplyPropertyChanges : 
        entitySetName:string * 
        changed:Object -> unit 
[<ObsoleteAttribute("Use ApplyCurrentValues instead")>]
[<BrowsableAttribute(false)>]
[<EditorBrowsableAttribute(EditorBrowsableState.Never)>]
override ApplyPropertyChanges : 
        entitySetName:string * 
        changed:Object -> unit
public function ApplyPropertyChanges(
    entitySetName : String, 
    changed : Object
)

パラメーター

  • entitySetName
    型 : System.String
    オブジェクトが属しているエンティティ セットの名前。
  • changed
    型 : System.Object
    元のオブジェクトに適用するプロパティ更新を含むデタッチしたオブジェクト。

例外

例外 状態
ArgumentNullException

entitySetName が null または空の文字列の場合、あるいは変更が null の場合。

InvalidOperationException

entitySetName からの EntitySet がオブジェクト EntityKeyEntitySet に一致しない場合、またはエンティティが Modified または Unchanged 以外の状態である場合、または元のオブジェクトがコンテキストに関連付けられていない場合。

ArgumentException

changed オブジェクトの型が元のオブジェクトの型とは異なる場合。

参照

参照

ObjectContext クラス

System.Data.Entity.Core.Objects 名前空間