0
(XML 구성 파일을 사용하여) StructureMap을 설정하는 방법을 알아 내려고합니다. 하나 개의 클래스는 2 클래스의 인스턴스를 포함하는 목록에 생성자가 있습니다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"매개 변수에 빈 목록이 포함됩니다 ... 드로잉 보드로 돌아갑니다. –