IServiceScopeFactory.CreateScope 方法

定義

建立 IServiceScope,其中包含用來解析新建立範圍相依性的 IServiceProvider

public:
 Microsoft::Extensions::DependencyInjection::IServiceScope ^ CreateScope();
public Microsoft.Extensions.DependencyInjection.IServiceScope CreateScope ();
abstract member CreateScope : unit -> Microsoft.Extensions.DependencyInjection.IServiceScope
Public Function CreateScope () As IServiceScope

傳回

控制範圍存留期的 IServiceScope。 一旦處置之後,任何已從 ServiceProvider 解析的範圍服務也會一併處置。 .

適用於