теперь можно так:
public class Parent
{
[MapField("ParentID"), /*[a]*/PrimaryKey/*[/a]*/]
public int ID;
/*[a]*/[Relation(typeof(Child))]/*[/a]*/
public List<Child> Children = new List<Child>();
}
[MapField("ParentID", "Parent.ID")]
public class Child
{
[MapField("ChildID"), /*[a]*/PrimaryKey/*[/a]*/]
public int ID;
/*[a]*/[Relation]/*[/a]*/
public Parent Parent = new Parent();
/*[a]*/[Relation(typeof(Grandchild))]/*[/a]*/
public List<Grandchild> Grandchildren = new List<Grandchild>();
}
[MapField("ChildID", "Child.ID")]
public class Grandchild
{
[MapField("GrandchildID"), /*[a]*/PrimaryKey/*[/a]*/]
public int ID;
/*[a]*/[Relation]/*[/a]*/
public Child Child = new Child();
}
[Test]
public void Test2()
{
List<Parent> parents = new List<Parent>();
/*[a]*/MapResultSet/*[/a]*/[] sets = new MapResultSet[3];
sets[0] = new MapResultSet(typeof(Parent), parents);
sets[1] = new MapResultSet(typeof(Child));
sets[2] = new MapResultSet(typeof(Grandchild));
using (DbManager db = new DbManager())
{
db
.SetCommand(TestQuery)
./*[a]*/ExecuteResultSet/*[/a]*/(sets);
}
Assert.IsNotEmpty(parents);
//...
}
по умолчанию индексы берутся по PrimaryKey, можно задать непосредственно аттрибутом.