Example #1
0
        public ActionResult Create(Boat boat)
        {
            if (ModelState.IsValid)
            {
                db.BoatSet.Add(boat);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(boat);
        }
Example #2
0
 public ActionResult Edit(Boat boat)
 {
     if (ModelState.IsValid)
     {
         db.Entry(boat).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(boat);
 }