The container supports the modules to load.
An example of the modules:
public class MyModule : InjectorModule
{
#region Overrides of InjectorModule
/// <summary>
/// Load bindings in current module.
/// </summary>
public override void Load()
{
Bind<IEmpty>().To<Empty>().InThreadScope();
}
#endregion
}
var injector = new MugenInjector(new MyModule());
var empty = injector.Get<IEmpty>();
injector.Unload("MyModule");
try
{
injector.Get<IEmpty>();
}
catch (Exception)
{
Console.WriteLine("Is always true");
}