Fix LINQ bug.

This commit is contained in:
Michael 2017-03-27 16:14:01 -04:00
parent 32e2eecdd4
commit 7111f0d5cd

View file

@ -46,7 +46,7 @@ public ForumPost[] UnreadPosts
var db = new ApplicationDbContext();
var posts = db.ForumPosts.Where(x => ACL.IsUnlisted(x.Parent) && db.ReadPosts.FirstOrDefault(y => y.UserId == this.Id && y.PostId == x.Id) == null);
var posts = db.ForumPosts.Where(x => db.ForumTopics.FirstOrDefault(z=>z.Id==x.Parent).IsUnlisted == false && db.ReadPosts.FirstOrDefault(y => y.UserId == this.Id && y.PostId == x.Id) == null);
return posts.ToArray();
}
}