EntityDataSourceContextDisposingEventArgs 类      
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为 ContextDisposing 事件提供数据。
public ref class EntityDataSourceContextDisposingEventArgs : System::ComponentModel::CancelEventArgspublic class EntityDataSourceContextDisposingEventArgs : System.ComponentModel.CancelEventArgstype EntityDataSourceContextDisposingEventArgs = class
    inherit CancelEventArgsPublic Class EntityDataSourceContextDisposingEventArgs
Inherits CancelEventArgs- 继承
示例
此示例通过处理 ContextCreated 事件来维护 ObjectContext 供将来引用。
protected void EntityDataSource2_ContextDisposing(object sender,   
    EntityDataSourceContextDisposingEventArgs e)  
{  
    e.Cancel = true;  
}  
注解
              ContextDisposing处理 事件,并将 对象的 属性EntityDataSourceContextDisposingEventArgs设置为 Canceltrue。 这可以防止处置 ObjectContext。 有关详细信息,请参阅 Object Context Life-Cycle Management (EntityDataSource) 。
属性
| Cancel | 获取或设置指示是否应取消事件的值。(继承自 CancelEventArgs) | 
| Context | 获取由数据源使用的 ObjectContext。 | 
方法
| Equals(Object) | 确定指定对象是否等于当前对象。(继承自 Object) | 
| GetHashCode() | 作为默认哈希函数。(继承自 Object) | 
| GetType() | 获取当前实例的 Type。(继承自 Object) | 
| MemberwiseClone() | 创建当前 Object 的浅表副本。(继承自 Object) | 
| ToString() | 返回表示当前对象的字符串。(继承自 Object) |