From 7111f0d5cd4123287d2510d77350d849afe7ea98 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Mar 2017 16:14:01 -0400 Subject: [PATCH] Fix LINQ bug. --- Project-Unite/Models/IdentityModels.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project-Unite/Models/IdentityModels.cs b/Project-Unite/Models/IdentityModels.cs index bf66238..5ec480f 100644 --- a/Project-Unite/Models/IdentityModels.cs +++ b/Project-Unite/Models/IdentityModels.cs @@ -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(); } }