The singleton lifestyle.
Inheritance Hierarchy
SimpleInjectorLifestyle
SimpleInjector.LifestylesSingletonLifestyle
Namespace: SimpleInjector.Lifestyles
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
The SingletonLifestyle type exposes the following members.
Properties
| Name | Description | |
|---|---|---|
| Length |
Gets the length of the lifestyle. Implementers must implement this property. The diagnostic
services use this value to compare lifestyles with each other to determine lifestyle
misconfigurations.
(Overrides LifestyleLength.) | |
| Name | Gets the user friendly name of this lifestyle. (Inherited from Lifestyle.) |
Methods
| Name | Description | |
|---|---|---|
| CreateProducer(Type, Type, Container) |
Creates a new InstanceProducer instance for the given serviceType
that will create new instances of specified implementationType with the
caching as specified by this lifestyle.
(Inherited from Lifestyle.) | |
| CreateProducerTService(FuncTService, Container) |
Creates a new InstanceProducer instance for the given TService
that will create new instances instance using the supplied instanceCreator
with the caching as specified by this lifestyle.
(Inherited from Lifestyle.) | |
| CreateProducerTService(Type, Container) |
Creates a new InstanceProducer instance for the given TService
that will create new instances of specified implementationType caching as
specified by this lifestyle.
(Inherited from Lifestyle.) | |
| CreateProducerTService, TImplementation(Container) |
Creates a new InstanceProducer instance for the given TService
that will create new instances of specified TImplementation with the
caching as specified by this lifestyle.
(Inherited from Lifestyle.) | |
| CreateRegistration(Type, Container) |
Creates a new Registration instance defining the creation of the
specified concreteType with the caching as specified by this lifestyle,
or returns an already created Registration instance for this container + lifestyle
+ type combination.
This method might fail when run in a partial trust sandbox when concreteType
is an internal type.
(Inherited from Lifestyle.) | |
| CreateRegistration(Type, FuncObject, Container) |
Creates a new Registration instance defining the creation of the
specified serviceType using the supplied instanceCreator
with the caching as specified by this lifestyle.
| |
| CreateRegistration(Type, Object, Container) |
Creates a new Registration instance defining the creation of the
specified instance. Properties, decorators, interceptors, and initializers
may be applied to this instance.
| |
| CreateRegistrationTConcrete(Container) |
Creates a new Registration instance defining the creation of the
specified TConcrete with the caching as specified by this lifestyle,
or returns an already created Registration instance for this container + lifestyle
+ type combination.
(Inherited from Lifestyle.) | |
| CreateRegistrationTService(FuncTService, Container) |
Creates a new Registration instance defining the creation of the
specified TService using the supplied instanceCreator
with the caching as specified by this lifestyle.
(Inherited from Lifestyle.) | |
| CreateRegistrationCore(Type, Container) |
When overridden in a derived class,
creates a new Registration instance defining the creation of the
specified concreteType with the caching as specified by this lifestyle.
(Overrides LifestyleCreateRegistrationCore(Type, Container).) | |
| CreateRegistrationCoreTService(FuncTService, Container) |
When overridden in a derived class,
creates a new Registration instance defining the creation of the
specified TService using the supplied instanceCreator
with the caching as specified by this lifestyle.
(Inherited from Lifestyle.) | |
| CreateRegistrationCoreTService(FuncTService, Container) |
When overridden in a derived class,
creates a new Registration instance defining the creation of the
specified TService using the supplied instanceCreator
with the caching as specified by this lifestyle.
(Overrides LifestyleCreateRegistrationCoreTService(FuncTService, Container).) |
See Also