ReadonlyserviceA child IServiceProvider that resolves services within this scope.
Implements the asynchronous AsyncDisposable protocol. Delegates to
asyncDispose.
Implements the synchronous Disposable protocol. Delegates to
dispose.
Asynchronously disposes all scoped services that implement
Symbol.asyncDispose or Symbol.dispose, in reverse creation order
(LIFO).
For each service:
Symbol.asyncDispose, that method is awaited.Symbol.dispose, that method is called
synchronously.Synchronously disposes all scoped services that implement
Symbol.dispose, in reverse creation order (LIFO).
Services that only implement Symbol.asyncDispose are skipped during
synchronous disposal. Use asyncDispose to properly dispose all
services including async ones.
A scoped service container that caches Scoped services for the duration of its lifetime. Obtain instances via ServiceProvider.createScope.
The scope tracks all created scoped services that implement
DisposableorAsyncDisposableand disposes them in reverse creation order (LIFO) when the scope is disposed. This matches .NET's scope disposal semantics.Supports the
usingkeyword viaSymbol.disposeandSymbol.asyncDispose:Example: Synchronous disposal
Example: Asynchronous disposal
Example: Manual disposal
See