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,可用來解析範圍服務。