ServiceLifetime 열거형

정의

IServiceCollection에서 서비스의 수명을 지정합니다.

public enum class ServiceLifetime
public enum ServiceLifetime
type ServiceLifetime = 
Public Enum ServiceLifetime
상속
ServiceLifetime

필드

Scoped 1

각 범위에 대해 서비스의 새 인스턴스를 만들도록 지정합니다. ASP.NET Core 앱에서 범위는 각 서버 요청으로 만들어집니다.

Singleton 0

서비스의 단일 인스턴스를 만들도록 지정합니다.

Transient 2

요청할 때마다 서비스의 새 인스턴스를 만들도록 지정합니다.

적용 대상