I have a table called BlogPost which has a 1-to-many relationship with the Comment table. (In Comment, there's a foreign key BlogPostId.)
Now I want to retrieve all posts as well as the latest comments of each post. I've tried with s/t like below but it doesn't work.
from r in Db.BlogPost
select new {Post = r, LatestComment = r.Comments.Last()};
The error message sounds like Last() is not a supported operator by EF. Is there any way to handle this?