@ -13,7 +13,7 @@ The `Install()` method installs the given [`IRegistrationBase`s](IRegistrationBa
To create your own installer, you have to implement the `IIocInstaller` interface and the `Install()` method. Inside the `Install()` method you have to register the [`IRegistrationBase`s](IRegistrationBase) with the given `IIocContainer`:
This is done by writing the IL code for the `Create()` methods manually that call the `IocContainer.Resolve()` method, as well as the `ClearMultitonInstance` method that calls the `IocContainer.ClearMultitonInstances<>()` method.
## `IUnitTestCallbackRegistration<TInterface>`
The `IUnitTestCallbackRegistration` is a special `IRegistrationBase` that allows to set a `ResolveCallback<TInterface>` as a callback that is called on `IIocContainer.Resolve<T>`. This can be useful if you for whatever reason need some special handling for unit tests.
The `ResolveCallback<TInterface>` looks like this:
```c#
public delegate TInterface ResolveCallback<outTInterface>(params object[] parameters);
@ -8,12 +8,12 @@ The lifestyles are part of the enum `Lifestyle`.
Using the `Transient`-Lifestyle, a new instance gets created every time an instance is resolved.
`Transient` instances are not tracked by the `IocContainer`, so once you don't need them anymore they can be claimed by the garbage collector without leaking memory.
:information_source: This is the default `Lifestyle` that the [`RegistrationFactory`](RegistrationFactory) uses.
:information_source: This is the default `Lifestyle` that the `IocContainer` uses.
The `RegistrationFactory` is a helper class to register interfaces and factories in an [`IIocInstaller`](IIocInstaller) and create the needed [`IRegistrationBase`s](IRegistrationBase).
> The `RegistrationFactory` is private helper class. These methods will be used when you call `IIocContainer.Register<>()`.
## Registering classes
The way classes are registered depends on their [`Lifestyle`](Lifestyles).
@ -15,13 +15,7 @@ There are multiple ways to accomplish this and the best solution depends on the
In this simple usage guide we will only take a look at the most straightforward way that is to just register the interfaces and their classes with the `IocContainer`:
To make this even easier there is a [`RegistrationFactory`](RegistrationFactory) that helps you create the [`IRegistrationBase`](IRegistrationBase) you need: