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.IServiceScope which contains an System.IServiceProvider used to resolve dependencies from a newly created scope.

Return type:Microsoft.Extensions.DependencyInjection.IServiceScope
Returns:An Microsoft.Extensions.DependencyInjection.IServiceScope controlling the lifetime of the scope. Once this is disposed, any scoped services that have been resolved from the Microsoft.Extensions.DependencyInjection.IServiceScope.ServiceProvider will also be disposed.
IServiceScope CreateScope()