LifecyclePolicy.singleton
Optional priority that determines the preferred implementation when multiple implementations are available; a higher number is preferred over a lower number. Services are registered with a priority of 0 by default.
Note: Negative numbers are allowed and supported
Determines how a service is created and maintained in the container. A service with a lifecycle of
singleton
will be created once and is reused across resolutions. A service with a lifecycle oftransient
will be created each time it is resolved.