The `Singleton`-Lifestyle is used to always get the same instance every time an instance is resolved.
The `Singleton`-Lifestyle is used to always get the same instance every time an instance is resolved.
This is specifically useful if you have a service that needs to be accesses by multiple components of your application.
`Singleton` instances will be created the first time they are requested and then reused whenever they are needed. They are bound to the `IocContainer` and will only be released once the `IocContainer` is disposed.
This is specifically useful if you have a service that needs to be accessed by multiple components of your application.
When using the `Multiton`-Lifestyle, a new instance gets created if the given scope has no created instance yet. Otherwise the already created instance is used.
`Multiton` instances will be created the first time they are requested for a given scope and then reused whenever requested for their scope.
They are also bound to the `IocContainer` but different to singletons, they can be cleared when you need to do so by calling `IocContainer.ClearMultitonInstances<T>()`.
They will also be released once the `IocContainer` is disposed.