0
我想弄清楚如何设置StructureMap(使用XML配置文件)。一类具有包含第二类的实例列表的构造函数:StructureMap非原始类型列表
public interface ITestDocType { }
class TestDocType : ITestDocType
{
public List<AttributeRef> AttrRefs { get; set; }
public TestDocType(List<AttributeRef> attrRefs)
{
AttrRefs = attrRefs;
}
}
public class AttributeRef
{
public AttributeRef(string name, string xpath, string value)
{
Name = name;
Xpath = xpath;
Value = value;
}
public string Name { get; set; }
public string Xpath { get; set; }
public string Value { get; set; }
}
我希望能够内嵌AttributeRef的情况下,在我的配置文件,但不完全确定如何做(或者其可能)。
<DefaultInstance PluginType="ITestDocType" PluggedType="TestDocType">
<attrRefs>
// Would like to specify one to many AttributeRef instances inline here
</attrRefs>
</DefaultInstance>
好吧,所以这不会按照它应该的方式工作......当父实例被检索到时,“attrRefs”参数包含一个空列表......回到绘图板。 – 2010-04-09 13:29:27