AsyncServiceScope Struct

Definition

An IServiceScope implementation that implements IAsyncDisposable.

C#
public readonly struct AsyncServiceScope : IAsyncDisposable, IDisposable, Microsoft.Extensions.DependencyInjection.IServiceScope
Inheritance
AsyncServiceScope
Implements

Constructors

AsyncServiceScope(IServiceScope)

Initializes a new instance of the AsyncServiceScope struct. Wraps an instance of IServiceScope.

Properties

ServiceProvider

The IServiceProvider used to resolve dependencies from the scope.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

Extension Methods

ConfigureAwait(IAsyncDisposable, Boolean)

Configures how awaits on the tasks returned from an async disposable will be performed.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)