Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var comments = db.Comments.Where(c =>
- c.Post.ID == id
- && c.Status == Helpers.StatusCode.Visible
- )
- .Select(x => new CommentTemp()
- {
- Id = x.ID,
- Text = x.Text,
- Avatar = "-1",
- Username = (x.User != null ? x.User.UserName : "Anonymous"),
- UserID = (x.User != null ? (int?) x.User.Id : null),
- ResponseTo = (x.ResponseTo == null ? null : (int?) x.ResponseTo.ID),
- CommentDepth = ??? // <--- how do i select the depth of the response to relations?
- Created = x.Created
- }).ToList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement