public IActionResult Edit(RestaurantModel model) { try { if (model.RestaurantId > 0) { _restaurantService.Edit(model); } else { _restaurantService.Add(model); } return(RedirectToAction("Index")); } catch (Exception ex) { _logger.LogError(ex, "Failed to load retaurant details"); return(RedirectToAction("Edit", model.RestaurantId)); } }