I am looking for a way to do something like this with Ninject :
// Sample from the Unity application block
IMyService result = myContainer.Resolve<IMyService>("Data");
( from http://msdn.microsoft.com/en-us/library/cc440957.aspx )
Is it possible?
Ninject 2.0 has this capability:
Bind<IMyService>().To<MyServiceA>().Named("Data");
Bind<IMyService>().To<MyServiceB>().Named("SomethingElse");
kernel.Get<IMyService>("Data"); // will return MyServiceA
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With