我有一个希望简单的问题,一个参数的对象...注册,有一个字符串数组作为使用温莎城堡流利的注册API
我试图从XML注册到流利注册API在发生变化,但在注册需要数组作为构造函数参数的对象时遇到了一个问题。
例如
<component id="Example" lifestyle="transient"
service="Test, Example.Test"
type="Test, Example.Test">
<parameters>
<C>
<array>
<item>Value One</item>
<item>Value Two</item>
</array>
</C>
</parameters>
</component>
我怎么会去用流利的API注册呢?
//the constructor for test is Test(string[] C){}
_container.Register(Component.For<Test>().ImplementedBy<Test>().Parameters(
Parameter
.ForKey("C")
.Eq(new string[]{"Value one","Value two"})
));
顺便说一句if service == type你不需要ImplementedBy – 2010-01-18 21:56:27