我有一個表格定義如下:
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查詢映射到父子層次結構對象?
任何建議或想法都是受歡迎的。