Zdieľať cez


ServiceProviderServiceExtensions.CreateScope(IServiceProvider) Method

Definition

Creates a new IServiceScope that can be used to resolve scoped services.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceScope ^ CreateScope(IServiceProvider ^ provider);
public static Microsoft.Extensions.DependencyInjection.IServiceScope CreateScope (this IServiceProvider provider);
static member CreateScope : IServiceProvider -> Microsoft.Extensions.DependencyInjection.IServiceScope
<Extension()>
Public Function CreateScope (provider As IServiceProvider) As IServiceScope

Parameters

provider
IServiceProvider

The IServiceProvider to create the scope from.

Returns

A IServiceScope that can be used to resolve scoped services.

Applies to