Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ServiceProviderServiceExtensions.CreateAsyncScope Method

Definition

Namespace:
Microsoft.Extensions.DependencyInjection
Assembly:
Microsoft.Extensions.DependencyInjection.Abstractions.dll
Package:
Microsoft.Extensions.DependencyInjection.Abstractions v11.0.0-preview.5.26302.115

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.

Overloads

Name Description
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.

CreateAsyncScope(IServiceScopeFactory)

Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs

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

CreateAsyncScope(IServiceProvider)

Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs

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


Feedback

Was this page helpful?