Badges.Controllers.NotificationsController.View C# (CSharp) Method

View() public method

public View ( System.Guid id ) : System.Web.Mvc.ActionResult
id System.Guid
return System.Web.Mvc.ActionResult
        public ActionResult View(Guid id)
        {
            var notification = RepositoryFactory.NotificationRepository.Queryable
                                                    .SingleOrDefault(x => x.Id == id);

            if (notification == null)
            {
                return new HttpNotFoundResult();
            }

            notification.Pending = false;
            RepositoryFactory.NotificationRepository.EnsurePersistent(notification);

            var model = new NotificationViewModel
            {
                Notification = notification
            };

            return View(model);
        }