public ActionResult Index() { var currentUserId = User.Identity.GetUserId(); var notifications = _userNotificationRepository.GetNotificationsByUserId(currentUserId, true).OrderByDescending(n => n.CreatedOn).ToList(); return(View(notifications)); }
public IHttpActionResult GetUnreadNotificationCountByUser(string userId) { var unreadNotifications = _notificationRepository.GetNotificationsByUserId(userId, true); return(Ok(new { notificationCount = unreadNotifications.Count() })); }