public ActionResult <List <GetFoodByRestaurantId> > GetFoodByRestaurantId(int restaurantId) { try { var result = _repository.GetFoodByRestaurant(restaurantId); IMapper mapper = EDeliveryProfile.GetFoodRestaurantById(); return(mapper.Map <List <GetFoodByRestaurantId> >(result)); } catch (Exception ex) { _logger.LogError($"Failed to get food by restaurant Id: {ex}"); return(BadRequest("Failed to get food by restaurant Id:")); } }