Click or drag to resize

IDisposerAddInstanceForAsyncDisposal Method

Adds an object to the disposer, where that object implements IAsyncDisposable. When the disposer is disposed, so will the object be. You should most likely implement IDisposable as well, and call AddInstanceForDisposal(IDisposable) instead of this method.

Namespace:  Autofac.Core
Assembly:  Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
Syntax
void AddInstanceForAsyncDisposal(
	IAsyncDisposable instance
)

Parameters

instance
Type: IAsyncDisposable
The instance.
Remarks
If the provided object only implements IAsyncDisposable, and the IDisposer is disposed of using a synchronous Dispose call, that call will throw an exception when it attempts to dispose of the provided instance.
See Also