Return a component instance by key (using Ninject Container)
Is it possible to return a component ins开发者_如何转开发tance by key using Ninject?
The equivalent to Castle Windsor is for ex.:
container.Register(Component.For< ConcreteA >().Named("KeyForConcreteA"));
Bind<ConcreteA>().ToSelf().Named("KeyForConcreteA")
var a = kernel.Get<ConcreteA>("KeyForConcreteA");
精彩评论