DataContext.Dispose 方法

定義

釋放 DataContext 類別所使用的資源。Releases the resources used by the DataContext class.

多載

Dispose()

釋放 DataContext 類別目前的執行個體所使用的全部資源。Releases all resources used by the current instance of the DataContext class.

Dispose(Boolean)

釋放 DataContext 類別所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the DataContext class and optionally releases the managed resource.

Dispose()

釋放 DataContext 類別目前的執行個體所使用的全部資源。Releases all resources used by the current instance of the DataContext class.

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

實作

Dispose(Boolean)

釋放 DataContext 類別所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the DataContext class and optionally releases the managed resource.

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

參數

disposing
Boolean

true 表示釋放 Managed 和 Unmanaged 資源,false 則表示只釋放 Unmanaged 資源。true to release both managed and unmanaged resources; false to release only unmanaged resources.

適用於