This linq query works, and it does what I want it to do, but is there any other way I could improve the query so I'm not repeating a.AnswerRevisions.OrderByDescending(r => r.DateCreated).FirstOrDefault()
?
IQueryable<Article> query = from a in _db.Articles
orderby a.DateCreated descending
where a.AnswerRevisions.Count > 0 &&
(a.AnswerRevisions.OrderByDescending(r => r.DateCreated).FirstOrDefault().UpVotes -
a.AnswerRevisions.OrderByDescending(r => r.DateCreated).FirstOrDefault().DownVotes < 0)
select a;
.UpVotes < .Downvotes
. \$\endgroup\$