EntityDataSourceContextDisposingEventArgs EntityDataSourceContextDisposingEventArgs EntityDataSourceContextDisposingEventArgs EntityDataSourceContextDisposingEventArgs Class


Provides data for the ContextDisposing event.

public ref class EntityDataSourceContextDisposingEventArgs : System::ComponentModel::CancelEventArgs
public class EntityDataSourceContextDisposingEventArgs : System.ComponentModel.CancelEventArgs
type EntityDataSourceContextDisposingEventArgs = class
    inherit CancelEventArgs
Public Class EntityDataSourceContextDisposingEventArgs
Inherits CancelEventArgs


This example maintains the ObjectContext for future reference by handling the ContextCreated event.

protected void EntityDataSource2_ContextDisposing(object sender,   
    EntityDataSourceContextDisposingEventArgs e)  
    e.Cancel = true;  


Handle the ContextDisposing event, and set the Cancel property of the EntityDataSourceContextDisposingEventArgs object to true. This prevents the disposal of the ObjectContext. For more information, see Object Context Life-Cycle Management (EntityDataSource).


Cancel Cancel Cancel Cancel

Gets or sets a value indicating whether the event should be canceled.

(Inherited from CancelEventArgs)
Context Context Context Context

Gets the ObjectContext used by the data source.


Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to