summaryrefslogtreecommitdiff
path: root/Project-Unite/ACL.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Project-Unite/ACL.cs')
-rw-r--r--Project-Unite/ACL.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs
index 73636c7..77e6f1d 100644
--- a/Project-Unite/ACL.cs
+++ b/Project-Unite/ACL.cs
@@ -13,6 +13,15 @@ namespace Project_Unite
{
public static class ACL
{
+ public static IHtmlString NotificationCount(this HtmlHelper hpr, string uid)
+ {
+ var db = new ApplicationDbContext();
+ var usr = db.Users.FirstOrDefault(x => x.Id == uid);
+ if (usr == null)
+ return hpr.Raw("N/A");
+ return hpr.Raw(usr.UnreadNotifications.ToString());
+ }
+
public static IHtmlString NewestUser(this HtmlHelper hpr)
{
var db = new ApplicationDbContext();