如何使用dapper.net创建对象层次结构?

如何使用dapper.net创建对象层次结构?,dapper,Dapper,我的表格定义如下: enter code here CREATE TABLE Milestone ( MilestoneID Int, MilestoneName Nvarchar(256), ParentMilestoneID Int ) enter code here public class Milestone { public int MilestoneID {get;set;} public string MilestoneName {g

我的表格定义如下:

enter code here

CREATE TABLE Milestone
( 
    MilestoneID Int,
    MilestoneName Nvarchar(256),
    ParentMilestoneID Int
)
enter code here

public class Milestone
{
    public int MilestoneID {get;set;}
    public string MilestoneName {get;set:}
    public Milestone milestone {get;set;}
}
类别定义如下:

enter code here

CREATE TABLE Milestone
( 
    MilestoneID Int,
    MilestoneName Nvarchar(256),
    ParentMilestoneID Int
)
enter code here

public class Milestone
{
    public int MilestoneID {get;set;}
    public string MilestoneName {get;set:}
    public Milestone milestone {get;set;}
}
如何将sql查询映射到父子层次结构对象


欢迎您提出任何建议或想法。

这不完全是一种层次结构,但最好是父子关系,我想您可以在名为的部分中查看