Pulse7
7/27/2017 - 12:12 PM

Post redirect pattern (protect against refresh double post)

Post redirect pattern (protect against refresh double post)

[HttpPost]
        public IActionResult Create(RestaurantEditViewModel model)
        {
            var restaurant = new Restaurant();
            restaurant.Cuisine = model.Cuisine;
            restaurant.Name = model.Name;
            _restaurantData.Add(restaurant);
            return RedirectToAction("Details",new { id=restaurant.Id});
        }