I am trying to determine if the current user has voted on a ProjectDoc. This query gives me a value of 1. There is no value in the ProjectDocVote table that matches the UserID. The ViewBag.CurrentUserID value is correct.
var count = Model.Project.ProjectDoc
.Where(a => a.Current == true && a.DocType == "Cover")
.Select(v => v.ProjectDocVote
.SingleOrDefault(u => u.UserID == ViewBag.CurrentUserID)
)
.Count();
How do I fix this query?
1 Answer