コード例 #1
0
        public ActionResult EditList(NewsLetterList model)
        {
            if (ModelState.IsValid)
            {
                db.Entry(model).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Lists"));
            }

            return(PartialView(model));
        }
コード例 #2
0
        public ActionResult CreateList(NewsLetterList model)
        {
            if (ModelState.IsValid)
            {
                db.NewsLetterLists.Add(model);
                db.SaveChanges();
                return(RedirectToAction("Lists"));
            }

            return(PartialView(model));
        }