共用方式為


ObjectStateManager.ObjectStateManagerChanged 事件

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

在狀態管理員中加入或移除實體時發生。

命名空間:  System.Data.Entity.Core.Objects
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
Public Event ObjectStateManagerChanged As CollectionChangeEventHandler
'用途
Dim instance As ObjectStateManager 
Dim handler As CollectionChangeEventHandler 

AddHandler instance.ObjectStateManagerChanged, handler
public event CollectionChangeEventHandler ObjectStateManagerChanged
public:
 event CollectionChangeEventHandler^ ObjectStateManagerChanged {
    void add (CollectionChangeEventHandler^ value);
    void remove (CollectionChangeEventHandler^ value);
}
member ObjectStateManagerChanged : IEvent<CollectionChangeEventHandler,
    CollectionChangeEventArgs>
JScript supports the use of events, but not the declaration of new ones.

請參閱

參考

ObjectStateManager 類別

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