コード例 #1
0
 public ActionResult Edit(Organization organization)
 {
     if (ModelState.IsValid)
     {
         db.Entry(organization).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(organization);
 }
コード例 #2
0
        public ActionResult Create(Organization organization)
        {
            if (ModelState.IsValid)
            {
                db.Organizations.Add(organization);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(organization);
        }