LINQ parent child relation
- by Shane Km
I'm working on the BLOG functionality in MVC. I need to be able to create 'blog comments'. So each comment may have a parent comment etc.
Given table "Comments":
CommentId - int - identity autoincrement
PostId - int
ParentId - int
Comment - string
Is there a way to get a list of comments for a given article ordered by CreateDate and ParentId?
Or maybe there is a better table design you may suggest. What is the best design when inserting Post comments like this?
I'm using Entity framework.
thanks