4

I have a table defination as below:

enter code here

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

Class defination as below:

enter code here

public class Milestone
{
    public int MilestoneID {get;set;}
    public string MilestoneName {get;set:}
    public Milestone milestone {get;set;}
}

How to mapping sql query to parent-child hierarchy objects?

Any suggestion or idea is welcome.

0

1 Answer 1

3

This is not exactly a hierarchy, but is better a parent-child relationship, I suppose you can look in the example page in the section called Multi Mapping.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.