Mugen Injection [Registering Bindings]
All bindings are registered with IInjectorBinder.
Bindings can be created using lambda expressions, by reflection, by method delegate, or by providing a ready-made instance.
You have two way to register binding, use method Bind or BindWithManualBuild. Methods perform the same operation, but has a different way to build. The method Bind will automatically put a binding in an IInjector, when it will be requested.
This code shows how work the Bind method:
// Create your MugenInjector. _injector = new MugenInjector(); //Registering dependency use a Bind method. _injector.Bind<IWriter>().To<ConsoleWriter>();
To resolve this situation you have to use the BindWithManualBuild method. This method will not automatically put a binding in an IInjector, you should do it.
This code shows how work the BindWithManualBuild method:
// Create your MugenInjector. _injector = new MugenInjector(); //Registering dependency use a BindWithManualBuild method. _injector.BindWithManualBuild<IWriter>().To<ConsoleWriter>().Build();