An implementation of an IoC Container
In order to use AdamIoC you need to pull down the source code, build it in visual studio 2017, and place a reference to the AdamIoC assembly to your project.
The project depends on .NET 4.6.1.
var container = new ContainerAdamIoC();
container.RegisterImplementation<ISomeInterface, SomeImplementation>();
...
2a. Optional parameters to method to control how often the instance should be created when resolving the instance
Transient - Create a new instance every time a new instance is called for
Singleton - Share the same instance each time the code asks for it
// this will take on the default LifecycleType of Transient
container.RegisterImplementation<ISomeInterface, SomeImplementation>();
container.RegisterImplementation<ISomeInterface, SomeImplementation>(LifecycleType.Transient);
container.RegisterImplementation<ISomeInterface, SomeImplementation>(LifecycleType.Singleton);
var instance = container.GetInstance<ISomeInterface>();
Each instance of the ContainerAdamIoC contains the registrations and the ability to create instances of an interface. If the code attempts to create an instance of a unregistered interface it will throw a NotRegisteredException.