コード例 #1
0
        public ActionResult Create(SkillLevel skilllevel)
        {
            if (ModelState.IsValid)
            {
                db.SkillLevels.Add(skilllevel);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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