Пример #1
0
        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());
        }
Пример #2
0
 public void Delete(DeleteRestaurant input)
 {
     _restaurantManager.Delete(input.Id);
 }