开发者

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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜