共用方式為


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

適用於