Ejemplo n.º 1
0
 public ActionResult Edit(Ristorante ristorante)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ristorante).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(ristorante);
 }
Ejemplo n.º 2
0
        public ActionResult Create(Ristorante ristorante)
        {
            if (ModelState.IsValid)
            {
                db.Ristorantes.Add(ristorante);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(ristorante);
        }