Mugen Injection [Registering bindings as method delegate]
The MugenInjector can accept a delegate to be used as a service creator, this code shows hot it work:
// Create your MugenInjector. _injector = new MugenInjector(); _injector.Bind<Alpha>().ToMethod(GetAlpha); private static Alpha GetAlpha(IBindingContext bindingContext) { return new Alpha(); }
public delegate T MethodBindingDelegate<out T>(IBindingContext bindingContext);
public delegate object MethodBindingDelegate(IBindingContext bindingContext);