How to conditionally bind a instance depending on the injected type using unity?
I'm used to Ninject, and for a specific project I'm asked to learn Unity. There is one thing i can't find information on how to do. In Ninject I can state: Bind<IWarrior>().To<Samurai>().Named("Samurai"); Bind<IWarrior>().To<Ninja>().Named("Ninja"); Bind<IWeapon>().To<Katana>().WhenInjectedInto(typeof(Samurai)); Bind<IWeapon>().To<Shuriken>().WhenInjectedInto(typeof(Ninja)); And then when one asks for the warrior named samurai, the samurai comes with kanana and the ninja comes with shurikens. As it should. I don't want to reference the container in the warriors to get the appropriate weapon,