IServiceScopeFactory Interface¶
- Namespace
Microsoft.Extensions.DependencyInjection- Assemblies
- Microsoft.Extensions.DependencyInjection.Abstractions
Syntax¶
public interface IServiceScopeFactory
-
interface
Microsoft.Extensions.DependencyInjection.IServiceScopeFactory
Methods¶
-
CreateScope()¶ Create an
Microsoft.Extensions.DependencyInjection.IServiceScopewhich contains anSystem.IServiceProviderused to resolve dependencies from a newly created scope.Return type: Microsoft.Extensions.DependencyInjection.IServiceScope Returns: An Microsoft.Extensions.DependencyInjection.IServiceScopecontrolling the lifetime of the scope. Once this is disposed, any scoped services that have been resolved from theMicrosoft.Extensions.DependencyInjection.IServiceScope.ServiceProviderwill also be disposed.IServiceScope CreateScope()
-