From 4e64bc79c0d96010726d4a72f6fed311176e0b6b Mon Sep 17 00:00:00 2001 From: Simon Gockner Date: Fri, 5 Jul 2019 14:24:58 +0200 Subject: [PATCH] - update code block --- Lifestyles.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lifestyles.md b/Lifestyles.md index f74329b..33b2a62 100644 --- a/Lifestyles.md +++ b/Lifestyles.md @@ -32,7 +32,12 @@ container.Register(RegistrationFactory.Register(Lifestyle.Singleton)) 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()`. +They are also bound to the `IocContainer` but different to singletons, they can be cleared when you need to do so by calling: + +```c# +IocContainer.ClearMultitonInstances() +``` + They will also be released once the `IocContainer` is disposed. This is how you register a class as `Multiton`: