public ActionResult Create(Restaurant restaurant) { if (ModelState.IsValid) { _db.Add(restaurant); _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(restaurant)); }
public ActionResult Create([Bind(Include = "Id,Name,City,Country")] Restaurant restaurant) { if (ModelState.IsValid) { _db.Add(restaurant); _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(restaurant)); }