예제 #1
0
        public ActionResult Create(Collection collection)
        {
            if (ModelState.IsValid)
            {
                db.Collections.Add(collection);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(collection);
        }
예제 #2
0
 public ActionResult Edit(Collection collection)
 {
     if (ModelState.IsValid)
     {
         db.Entry(collection).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(collection);
 }