共用方式為


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 或空字串,或者 changed 為 null 時。

InvalidOperationException

當 entitySetName 的 EntitySet 不符合物件 EntityKeyEntitySet,或者物件處於 ModifiedUnchanged 以外的狀態,或者原始物件並未附加至內容時。

ArgumentException

當 changed 物件的類型與原始物件的類型不同時。

請參閱

參考

ObjectContext 類別

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