Editare

Partajați prin


EntityDataSourceContextDisposingEventArgs Class

Definition

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
Inheritance
EntityDataSourceContextDisposingEventArgs

Examples

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

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

Remarks

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).

Properties

Cancel

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

(Inherited from CancelEventArgs)
Context

Gets the ObjectContext used by the data source.

Methods

Equals(Object)

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

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to