Я пытаюсь выяснить, как настроить StructureMap (используя файл конфигурации XML). Один класс имеет конструктор со списком, содержащим экземпляры 2-го класса:
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>