Example #1
0
        public IActionResult Create(RestaurantViewModel RVM)
        {
            if (ModelState.IsValid)
            {
                Restaurant R = new Restaurant
                {
                    Name    = RVM.Name,
                    Cuisine = RVM.Cuisine
                };

                R = restaurant.AddRes(R);
                // return View("Details", R);

                //To Fix the problem with above code
                return(RedirectToAction("Details", new { id = R.ID }));
            }
            else
            {
                return(View());
            }
        }