IServiceScope 接口

定义

Dispose() 方法将终止作用域生存期。The Dispose() method ends the scope lifetime. 调用 Dispose 后,所有已从 ServiceProvider 解析的作用域内服务都将被释放。Once Dispose is called, any scoped services that have been resolved from ServiceProvider will be disposed.

public interface class IServiceScope : IDisposable
public interface IServiceScope : IDisposable
type IServiceScope = interface
    interface IDisposable
Public Interface IServiceScope
Implements IDisposable
实现

属性

ServiceProvider

用于解析作用域中的依赖项的 IServiceProviderThe IServiceProvider used to resolve dependencies from the scope.

方法

Dispose()

执行应用程序定义的、与释放或重置非托管资源相关的任务。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(继承自 IDisposable)

适用于