public ActionResult Edit(ProjectModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            var project = db.Projects.Find(model.Id);

            db.Entry(project).CurrentValues.SetValues(model.ToDbModel());
            db.SaveChanges();
            return(RedirectToAction("Details", new { id = project.Id }));
        }
Beispiel #2
0
        public ActionResult Edit(IssueModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var issue = db.Issues.Find(model.Id);

            db.Entry(issue).CurrentValues.SetValues(model.ToDbModel());
            db.SaveChanges();
            return(RedirectToAction("Details", new { id = issue.Id }));
        }