I am not having a problem so much with the query as accessing the data or setting it up so I can pass it to the view.
Here's the expression
var distinctReplies = pd.Project.ProjectDoc
.SelectMany(i => i.Comment
.SelectMany(k => k.CommentReply
.Select(u => u.User)
).Distinct()
).Select(g => new {FirstName = g.FirstName, LastName = g.LastName, UserID = g.UserID})
.ToList();
After this expression I want to concat it with another one that is getting values from the same user model, I want to assign distinctReplies to a ViewBag variable and then be able to loop though it and do this
foreach (var user in @ViewBag.distinctReplies)
in a razor view.
However, to actually get at the values I have to do distinctReplies.Select(i => i.FirstName)
. Not sure how to deal with this.