diff --git a/Home.md b/Home.md index 94a1e51..ecf2b0c 100644 --- a/Home.md +++ b/Home.md @@ -27,6 +27,9 @@ Welcome to the Lightweight IOC Container wiki! - [Base interface](IIocInstaller#base-interface) - [`AssemblyInstaller`](IIocInstaller#assemblyInstaller) - [`IRegistrationBase`](IRegistrationBase) + - [`IDefaultRegistration`](IRegistrationBase#IDefaultRegistrationTInterface) + - [`IMultitonRegistration`](IRegistrationBase#IMultitonRegistrationTInterface) + - [`ITypedFactoryRegistration`](IRegistrationBase#ITypedFactoryRegistrationTFactory) - [Lifestyles](Lifestyles) - [`Lifestyle.Transient`](Lifestyles#lifestyletransient) - [`Lifestyle.Singleton`](Lifestyles#lifestylesingleton) diff --git a/IRegistrationBase.md b/IRegistrationBase.md index 08e9a83..775af59 100644 --- a/IRegistrationBase.md +++ b/IRegistrationBase.md @@ -1,7 +1,53 @@ -The `IRegistrationBase` is an interface that is used to register an interface with the `IocContainer`. +The `IRegistrationBase` is a base interface for all registration classes that are used to register interfaces with the `IocContainer`. + +It consists only of two properties: + +```c# +/// +/// The name of the +/// +string Name { get; } +``` + +and + +```c# +/// +/// The of the Interface that is registered with this +/// +Type InterfaceType { get; } +``` ## `IDefaultRegistration` +This is the default registration that is used to register a `Type` for the interface it implements. `TInterface` is the `Type` of the interface. + +In addition to the implemented properties from the `IRegistrationBase` the `IDefaultRegistration` adds the following properties and methods: + +- The Type that implements the `IRegistrationBase.InterfaceType` that gets registered + + ```c# + Type ImplementationType { get; } + ``` + +- The `Lifestyle` of the registered `Type` + + ```c# + Lifestyle Lifestyle { get; } + ``` + +- An `Action` that is invoked when an instance of the registered type is created + + ```c# + Action OnCreateAction { get; } + ``` + +- A method to pass the `OnCreateAction` to the `IDefaultRegistration` + + ```c# + IDefaultRegistration OnCreate(Action action); + ``` + ## `IMultitonRegistration` ## `ITypedFactoryRegistration`