Hi there,
You don't need to query them separately; each Review already contains a reference to its associated UserComments. The following should work and displays all comments for all reviews:
Code:
var allGenres = from genre in myDataContext.Genres
orderby genre.Name
select new { genre.Name, genre.Reviews };
foreach (var genre in allGenres)
{
foreach (var review in genre.Reviews)
{
foreach (var userComment in review.UserComments)
{
string comment = userComment.Comment;
}
}
}
Hope this helps,
Imar