From a9b8092732e2012ffadc552052e2e070cbf380e4 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 Apr 2017 08:30:58 -0400 Subject: SignalR notifications --- Project-Unite/ACL.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Project-Unite/ACL.cs') diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs index 3bfc524..eb8cf72 100644 --- a/Project-Unite/ACL.cs +++ b/Project-Unite/ACL.cs @@ -62,6 +62,15 @@ namespace Project_Unite return hpr.Raw(builder.ToString()); } + internal static object NotificationCountRaw(string uid) + { + var db = new ApplicationDbContext(); + var usr = db.Users.FirstOrDefault(x => x.Id == uid || x.UserName == uid); + if (usr == null) + return 0; + return usr.UnreadNotifications; + } + public static bool IsUnlisted(string topicId) { return new ApplicationDbContext().ForumTopics.FirstOrDefault(x => x.Id == topicId).IsUnlisted; -- cgit v1.2.3