我有一個希望簡單的問題,一個參數的對象...註冊,有一個字符串數組作爲使用溫莎城堡流利的註冊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