Ejemplo n.º 1
0
        public ActionResult Close(Issue issue)
        {
            if (Session["User"] == null)
            {
                return(RedirectToAction("Login", "Account"));
            }
            var    context      = new TrackerDbContext();
            Status closed       = context.Statuses.Where(x => x.Id == 4).FirstOrDefault();
            Issue  issueToClose = context.Issues.Where(x => x.Id == issue.Id).Include(x => x.Notifications).FirstOrDefault();

            issueToClose.Archive(closed);
            context.SaveChanges();
            return(RedirectToAction("List"));
        }