I have a database table that stores parent and child entries similar to a category table. The ParentID field of this table contains the identifier of the parent record entry ...
My table columns: SectionID, Title, Number, ParentID, Active
I just plan to allow parental relationships with the child go on two levels. Therefore, I have a section and a subsection and what it is.
I need to output this data to my MVC view page in the form of a diagram, for example ...
- Section 1
- Subsection 1 of 1
- Subsection 2 of 1
- Subsection 3 of 1
- Section 2
- Subsection 1 of 2
- Subsection 2 of 2
- Subsection 3 of 2
- Section 3
Entity Framework 4.0 MVC 2.0 - LINQ. FK, , ParentID SEIDID, , EF "Section", Sub-Sections - , , , .
, , LINQ. - , , , ?

Update:
EDMX, , , .
var sections = from section in dataContext.Sections
where section.Active == true && section.ParentID == 0
orderby section.Number
select new Section
{
SectionID = section.SectionID,
Title = section.Title,
Number = section.Number,
ParentID = section.ParentID,
Timestamp = section.Timestamp,
Active = section.Active,
Children = section.Children.OrderBy(c => c.Number)
};
.
'System.Linq.IOrderedEnumerable' 'System.Data.Objects.DataClasses.EntityCollection'