From 93734dd552b9c95da23b517ea1f65854f22c68f6 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Mar 2017 15:47:54 -0400 Subject: Unread posts backend. --- Project-Unite/ACL.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Project-Unite/ACL.cs') diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs index 88e2fc2..ca356f9 100644 --- a/Project-Unite/ACL.cs +++ b/Project-Unite/ACL.cs @@ -67,6 +67,11 @@ namespace Project_Unite return hpr.Raw(CommonMark.CommonMarkConverter.Convert(hpr.Encode(md))); } + public static int UnreadPostsCount(string username) + { + return new ApplicationDbContext().Users.FirstOrDefault(x => x.UserName == username).UnreadPosts.Length; + } + public static bool IsFollowed(string you, string fId) { var db = new ApplicationDbContext(); -- cgit v1.2.3