AsyncServiceScope 结构
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
实现 IAsyncDisposable的 IServiceScope 实现。
public value class AsyncServiceScope : IAsyncDisposable, IDisposable, Microsoft::Extensions::DependencyInjection::IServiceScope
C#
public readonly struct AsyncServiceScope : IAsyncDisposable, IDisposable, Microsoft.Extensions.DependencyInjection.IServiceScope
type AsyncServiceScope = struct
interface IServiceScope
interface IDisposable
interface IAsyncDisposable
Public Structure AsyncServiceScope
Implements IAsyncDisposable, IDisposable, IServiceScope
- 继承
- 实现
Async |
初始化 AsyncServiceScope 结构的新实例。 包装 IServiceScope的实例。 |
Service |
用于从范围解析依赖项的 IServiceProvider。 |
Dispose() |
执行与释放、释放或重置非托管资源关联的应用程序定义任务。 |
Dispose |
以异步方式执行与释放、释放或重置非托管资源关联的应用程序定义任务。 |
Configure |
配置如何执行从异步可释放项返回的任务的 await。 |
产品 | 版本 |
---|---|
.NET | 6, 7, 8, 9 |
.NET Framework | 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |