ServiceProviderServiceExtensions.CreateAsyncScope Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
CreateAsyncScope(IServiceScopeFactory) |
Creates a new AsyncServiceScope that can be used to resolve scoped services. |
CreateAsyncScope(IServiceProvider) |
Creates a new AsyncServiceScope that can be used to resolve scoped services. |
Creates a new AsyncServiceScope that can be used to resolve scoped services.
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
Parameters
- serviceScopeFactory
- IServiceScopeFactory
The IServiceScopeFactory to create the scope from.
Returns
An AsyncServiceScope that can be used to resolve scoped services.
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
Creates a new AsyncServiceScope that can be used to resolve scoped services.
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
Parameters
- provider
- IServiceProvider
The IServiceProvider to create the scope from.
Returns
An AsyncServiceScope that can be used to resolve scoped services.
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: