IoC - Multiple implementations support for a single interface

后端 未结 7 1499
清歌不尽
清歌不尽 2020-12-30 02:50

I am wondering why .Net IoC containers do not easily support multiple implementations for a single interface! May be I am wrong, but as far I have seen, frameworks like Nin

7条回答
  •  -上瘾入骨i
    2020-12-30 03:09

    StructureMap provides these abilities:

    For().Add().Named("MyInterfaceImpl1");
    For().Add().Ctor().Is(i => i.GetInstance("MyInterfaceImpl1"));
    

提交回复
热议问题