Share via


ServiceProvider.DisposeAsync Method

Definition

Asynchronously disposes the service provider and all resolved services that implement IDisposable or IAsyncDisposable.

public:
 virtual System::Threading::Tasks::ValueTask DisposeAsync();
public System.Threading.Tasks.ValueTask DisposeAsync();
abstract member DisposeAsync : unit -> System.Threading.Tasks.ValueTask
override this.DisposeAsync : unit -> System.Threading.Tasks.ValueTask
Public Function DisposeAsync () As ValueTask

Returns

A value task that represents the asynchronous operation.

Implements

Remarks

Awaiting individual DisposeAsync() calls uses ConfigureAwait(false), so when an asynchronous dispose operation yields, its continuations do not attempt to resume on the original synchronization context. Services should not rely on disposal continuations running on any particular context.

Applies to