ServiceLifetime Énumération
Définition
Spécifie la durée de vie d’un service dans un IServiceCollection.Specifies the lifetime of a service in an IServiceCollection.
public enum class ServiceLifetime
public enum ServiceLifetime
type ServiceLifetime =
Public Enum ServiceLifetime
- Héritage
Champs
Scoped | 1 | Spécifie qu’une nouvelle instance du service sera créée pour chaque étendue.Specifies that a new instance of the service will be created for each scope. |
Singleton | 0 | Spécifie qu’une seule instance du service sera créée.Specifies that a single instance of the service will be created. |
Transient | 2 | Spécifie qu’une nouvelle instance du service sera créée chaque fois qu’une demande est effectuée.Specifies that a new instance of the service will be created every time it is requested. |