有没有办法将类的类型作为 Spring.NET 中的值传递?
我的字典看起来像这样:
private Dictionary<int, Type> ContentItemTypes { get; set; }
在代码中,我将初始化为:
registry.addContentItemType(0, typeof(ContentItem));
你如何在 Spring.NET 中做到这一点。到目前为止,我有这个:
<object id="ContentItemTypeRegistry"
type="Edu3.DomainModel.Framework.Model.Registry.ContentItemTypeRegistry, Edu3.DomainModel.Framework"
factory-method="GetInstance">
<property name="ContentItemTypes">
<dictionary key-type="int" value-type="System.Type">
<entry key="0">
<value type="System.Type">Edu3.DomainModel.Framework.Model.ContentItem</value>
</entry>
</dictionary>
</property>
</object>
它是否正确?