<PackageReference Include="Nito.AsyncEx.Tasks" Version="5.0.0" />

Nito.AsyncEx.AwaitableDisposable<T>

public struct AwaitableDisposable<T> where T : IDisposable
An awaitable wrapper around a task whose result is disposable. The wrapper is not disposable, so this prevents usage errors like "using (MyAsync())" when the appropriate usage should be "using (await MyAsync())".
public AwaitableDisposable(Task<T> task)

Initializes a new awaitable wrapper around the specified task.

public static Task<T> op_Implicit(AwaitableDisposable<T> source)

Implicit conversion to the underlying task.

public Task<T> AsTask()

Returns the underlying task.

public ConfiguredTaskAwaitable<T> ConfigureAwait(bool continueOnCapturedContext)

Infrastructure. Returns a configured task awaiter for the underlying task.

public TaskAwaiter<T> GetAwaiter()

Infrastructure. Returns the task awaiter for the underlying task.