public RedirectToActionResult MarkForumRead(int id) { var user = _userRetrievalShim.GetUser(HttpContext); if (user == null) { throw new Exception("There is no logged in user. Can't mark forum read."); } var forum = _forumService.Get(id); if (forum == null) { throw new Exception(String.Format("There is no ForumID {0} to mark as read.", id)); } _lastReadService.MarkForumRead(user, forum); return(RedirectToAction("Index", HomeController.Name)); }
public RedirectToRouteResult MarkForumRead(int id) { var user = this.CurrentUser(); if (user == null) { throw new Exception("There is no logged in user. Can't mark forum read."); } var forum = _forumService.Get(id); if (forum == null) { throw new Exception(String.Format("There is no ForumID {0} to mark as read.", id)); } _lastReadService.MarkForumRead(user, forum); return(RedirectToAction("Index", ForumHomeController.Name)); }
public async Task <RedirectToActionResult> MarkForumRead(int id) { var user = _userRetrievalShim.GetUser(); if (user == null) { throw new Exception("There is no logged in user. Can't mark forum read."); } var forum = await _forumService.Get(id); if (forum == null) { throw new Exception($"There is no ForumID {id} to mark as read."); } await _lastReadService.MarkForumRead(user, forum); return(RedirectToAction("Index", HomeController.Name)); }