LINQ parent child relation

Posted by Shane Km on Stack Overflow See other posts from Stack Overflow or by Shane Km
Published on 2011-01-10T09:12:04Z Indexed on 2011/01/10 9:53 UTC
Read the original article Hit count: 201

Filed under:
|
|

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

alt text

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

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about mvc