コード例 #1
0
        public ActionResult Create(RegionType regiontype)
        {
            if (ModelState.IsValid)
            {
                db.RegionTypes.Add(regiontype);
                db.SaveChanges();

                return RedirectToAction("Index");
            }

            return View(regiontype);
        }
コード例 #2
0
        public ActionResult Edit(RegionType regiontype)
        {
            if (ModelState.IsValid)
            {
                db.Entry(regiontype).State = EntityState.Modified;
                db.SaveChanges();

                return RedirectToAction("Index");
            }
            return View(regiontype);
        }