public ActionResult <DeleteRestaurant> DeleteRestaurant(DeleteRestaurant model) { try { var oldRestaurant = _repository.GetRestaurantByID(model.RestaurantId); if (oldRestaurant == null) { return(NotFound("The restaurant with the given Id could not be find")); } _repository.DeleteRestaurant(oldRestaurant); return(Ok()); } catch (Exception ex) { _logger.LogError($"Failed to delete the restaurant:{ex}"); } return(BadRequest()); }
public void Delete(DeleteRestaurant input) { _restaurantManager.Delete(input.Id); }