Exemple #1
0
 public ActionResult Create(Cuisine cuisines)
 {
     _db.Cuisines.Add(cuisines);
     _db.SaveChanges();
     return(RedirectToAction("Details", "Restaurant", new { id = cuisines.RestaurantId }));
 }
 public ActionResult Create(Restaurant restaurants) //the parameter name "restaurants" refers to the actual table in the database, so it must have the same name as the table otherwise it will yell at you.
 {
     _db.Restaurants.Add(restaurants);
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }