コード例 #1
0
        public ActionResult Create(Structure structure)
        {
            if (ModelState.IsValid)
            {
                graduatesEntity.Structures.Add(structure);
                graduatesEntity.SaveChanges();
                return RedirectToAction("Index");
            }

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