From 8f1fbeadb243a486dce7bbfd9b932a551fd36350 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 23 Mar 2017 09:47:22 -0400 Subject: Display newest user in right navbar --- Project-Unite/ACL.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Project-Unite/ACL.cs') diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs index c0a0894..4b4e6b0 100644 --- a/Project-Unite/ACL.cs +++ b/Project-Unite/ACL.cs @@ -13,6 +13,16 @@ namespace Project_Unite { public static class ACL { + public static IHtmlString NewestUser(this HtmlHelper hpr) + { + var db = new ApplicationDbContext(); + var user = db.Users.OrderByDescending(x => x.JoinedAt).FirstOrDefault(); + if (user == null) + return hpr.Raw(@"No new users"); + else + return hpr.Raw("Our newest user, " + user.DisplayName + ""); + } + public static IHtmlString Markdown(this HtmlHelper hpr, string md) { return hpr.Raw(CommonMark.CommonMarkConverter.Convert(hpr.Encode(md))); -- cgit v1.2.3