public ActionResult Create([Bind(Include = "ID,Review_ID,Rating,Customer")] Reviews reviews)
        {
            if (ModelState.IsValid)
            {
                db.Reviews.Add(reviews);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(reviews));
        }
Exemple #2
0
        public ActionResult Create([Bind(Include = "ID,Name,Address,StyleOfFood,Avg_Rating")] Data.Restaurant restaurant)
        {
            if (ModelState.IsValid)
            {
                db.Restaurants.Add(restaurant);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(restaurant));
        }
 public void AddRestaurant(Restaurant item)
 {
     using (db = new Restaurant_ReviewDBEntities())
     {
         db.Restaurants.Add(LibraryToData(item));
         db.SaveChanges();
     }
 }