DbContext.Dispose DbContext.Dispose DbContext.Dispose Method

Definition

Overloads

Dispose() Dispose() Dispose()

Calls the protected Dispose method.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Disposes the context. The underlying ObjectContext is also disposed if it was created is by this context or ownership was passed to this context when this context was created. The connection to the database (DbConnection object) is also disposed if it was created is by this context or ownership was passed to this context when this context was created.

Dispose() Dispose() Dispose()

Calls the protected Dispose method.

public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Disposes the context. The underlying ObjectContext is also disposed if it was created is by this context or ownership was passed to this context when this context was created. The connection to the database (DbConnection object) is also disposed if it was created is by this context or ownership was passed to this context when this context was created.

protected virtual void Dispose (bool disposing);
abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit
Protected Overridable Sub Dispose (disposing As Boolean)

Parameters

disposing
Boolean Boolean Boolean

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Applies to