EntityDataSourceContextDisposingEventArgs 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 ContextDisposing 事件的資料。
public ref class EntityDataSourceContextDisposingEventArgs : System::ComponentModel::CancelEventArgs
public class EntityDataSourceContextDisposingEventArgs : System.ComponentModel.CancelEventArgs
type EntityDataSourceContextDisposingEventArgs = class
inherit CancelEventArgs
Public Class EntityDataSourceContextDisposingEventArgs
Inherits CancelEventArgs
- 繼承
範例
此範例透過處理ContextCreated事件來維持 以ObjectContext供未來參考。
protected void EntityDataSource2_ContextDisposing(object sender,
EntityDataSourceContextDisposingEventArgs e)
{
e.Cancel = true;
}
備註
處理事件ContextDisposing,並將物件的EntityDataSourceContextDisposingEventArgs屬性設Cancel為 true。 這防止了 ObjectContext的處理。 欲了解更多資訊,請參閱物件上下文 Life-Cycle 管理(實體資料來源)。
屬性
| 名稱 | Description |
|---|---|
| Cancel |
取得或設定一個值,指示事件是否應被取消。 (繼承來源 CancelEventArgs) |
| Context |
資料來源會 ObjectContext 使用。 |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |