2
我得到3行相同的評論作者,我如何做不同得到1 CommentingAuthor?與linq加入查詢不同
IEnumerable<CommentingAuthor> CommentingAuthor =
from p in db.Posts
join c in db.Comments on p.WebSite equals c.CommentWebSite
select new CommentingAuthor
{
PostAuthorName = p.PostAuthor,
AuthorProfilePicture = c.CommentWebSite
};
return View(CommentingAuthor);
'CommentingAuthor.Distinct()'應該工作。 –