ServiceProviderServiceExtensions.CreateScope(IServiceProvider) 方法

定义

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

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

参数

provider
IServiceProvider

从中创建作用域的 IServiceProvider

返回

可用于解析作用域内服务的 IServiceScope

适用于