ServiceProviderServiceExtensions.CreateAsyncScope 方法

定义

重载

CreateAsyncScope(IServiceScopeFactory)

新建可用于解析作用域内服务的 AsyncServiceScope

CreateAsyncScope(IServiceProvider)

新建可用于解析作用域内服务的 AsyncServiceScope

CreateAsyncScope(IServiceScopeFactory)

Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs

新建可用于解析作用域内服务的 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)

Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs

新建可用于解析作用域内服务的 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 ,可用于解析作用域内服务。

适用于