Table of Contents

Class DisposableBase

Namespace
FluentCommand
Assembly
FluentCommand.dll

Provides a base implementation of the IDisposable pattern, including support for asynchronous disposal on supported platforms.

public abstract class DisposableBase : IDisposable, IAsyncDisposable
Inheritance
DisposableBase
Implements
Derived
Inherited Members

Constructors

DisposableBase()

protected DisposableBase()

Properties

IsDisposed

Gets a value indicating whether this instance has been disposed.

protected bool IsDisposed { get; }

Property Value

bool

Methods

AssertDisposed()

Throws an ObjectDisposedException if this instance has already been disposed.

protected void AssertDisposed()

Dispose()

Releases all resources used by the current instance of the DisposableBase class.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the object and, optionally, releases the managed resources.

protected void Dispose(bool disposing)

Parameters

disposing bool

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

DisposeAsync()

Asynchronously releases all resources used by the current instance of the DisposableBase class.

public ValueTask DisposeAsync()

Returns

ValueTask

A ValueTask that represents the asynchronous dispose operation.

DisposeManagedResources()

Releases managed resources. Override this method to dispose managed resources in derived classes.

protected virtual void DisposeManagedResources()

DisposeResourcesAsync()

Asynchronously releases managed resources. Override this method to asynchronously dispose managed resources in derived classes.

protected virtual ValueTask DisposeResourcesAsync()

Returns

ValueTask

A ValueTask that represents the asynchronous dispose operation.

DisposeUnmanagedResources()

Releases unmanaged resources. Override this method to dispose unmanaged resources in derived classes.

protected virtual void DisposeUnmanagedResources()

~DisposableBase()

Finalizes an instance of the DisposableBase class. Releases unmanaged resources and performs other cleanup operations before the object is reclaimed by garbage collection.

protected ~DisposableBase()