ServiceProviderServiceExtensions.CreateAsyncScope 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
CreateAsyncScope(IServiceScopeFactory) |
新建可用于解析作用域内服务的 AsyncServiceScope。 |
CreateAsyncScope(IServiceProvider) |
新建可用于解析作用域内服务的 AsyncServiceScope。 |
CreateAsyncScope(IServiceScopeFactory)
新建可用于解析作用域内服务的 AsyncServiceScope。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::AsyncServiceScope CreateAsyncScope(Microsoft::Extensions::DependencyInjection::IServiceScopeFactory ^ serviceScopeFactory);
public static Microsoft.Extensions.DependencyInjection.AsyncServiceScope CreateAsyncScope (this Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory);
static member CreateAsyncScope : Microsoft.Extensions.DependencyInjection.IServiceScopeFactory -> Microsoft.Extensions.DependencyInjection.AsyncServiceScope
<Extension()>
Public Function CreateAsyncScope (serviceScopeFactory As IServiceScopeFactory) As AsyncServiceScope
参数
- serviceScopeFactory
- IServiceScopeFactory
从中创建作用域的 IServiceScopeFactory。
返回
一个 AsyncServiceScope ,可用于解析作用域内服务。
适用于
CreateAsyncScope(IServiceProvider)
新建可用于解析作用域内服务的 AsyncServiceScope。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::AsyncServiceScope CreateAsyncScope(IServiceProvider ^ provider);
public static Microsoft.Extensions.DependencyInjection.AsyncServiceScope CreateAsyncScope (this IServiceProvider provider);
static member CreateAsyncScope : IServiceProvider -> Microsoft.Extensions.DependencyInjection.AsyncServiceScope
<Extension()>
Public Function CreateAsyncScope (provider As IServiceProvider) As AsyncServiceScope
参数
- provider
- IServiceProvider
从中创建作用域的 IServiceProvider。
返回
一个 AsyncServiceScope ,可用于解析作用域内服务。