Structuremap-多个接口实现
|
我对Structuremap完全陌生,并且对如何连接具有多个实现的接口感到困惑。
可以说我有
Controller1
和Controller2
。我有由两个单独的类Class1ForInterface1
和ѭ4implemented实现的Interface1
。在Controller1
中,我要注入Class1ForInterFace1
,在Controller2
中,我要注入Class2ForInterface1
。
如何将其与structuremap连接?看来我只能有一个接口到具体类型的映射?
谢谢!
没有找到相关结果
已邀请:
1 个回复
秃拳割
如果您随后想要Class1ForMyInterface,则可以致电
还有几种方法可以在容器中映射所有这些内容
或者,如果您保留注册类型时返回的smartinsatance,则可以在映射中使用它。