Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Category
- {
- public int Id { get; set; }
- public int ParentCategoryId { get; set; }
- public string ChildIDs { get; set; }
- }
- from cg in db.Categories
- where cg.Id == id
- join urc in
- (from x in db.UrlRecords where x.EntityName == "Category" select x) on cg.Id equals urc.EntityId into urccg
- from f in urccg.DefaultIfEmpty()
- select new
- {
- cg,
- f,
- ParentCategoryId = cg.ParentCategoryId,
- ChildIds = string.Join(",", (from x in db.Categories where x.ParentCategoryId == cg.Id select x.Id))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement