Exemplo n.º 1
0
        public async Task <ActionResult <FoodType_FoodTypeDTO> > Get([FromBody] FoodType_FoodTypeDTO FoodType_FoodTypeDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            FoodType FoodType = await FoodTypeService.Get(FoodType_FoodTypeDTO.Id);

            return(new FoodType_FoodTypeDTO(FoodType));
        }
Exemplo n.º 2
0
 public IActionResult GetFoodType(int id)
 {
     try
     {
         return(Ok(_foodTypeService.Get(id).ToApiModel()));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("UpdateItem", ex.Message);
         return(BadRequest(ModelState));
     }
 }
Exemplo n.º 3
0
        public async Task <IActionResult> GetAllDataForTour()
        {
            TourView tour = new TourView();

            tour.Hotels = await _hotelService.Get();

            tour.FoodTypes = await _foodTypeService.Get();

            tour.TourTypes = await _tourTypeService.Get();

            tour.TransportTypes = await _transportTypeService.Get();

            tour.CitiesFrom = await _cityFromService.Get();

            tour.Cities = await _cityService.Get();

            tour.Countries = await _countryService.Get();

            tour.PlacementTypes = await _placementTypeService.Get();

            return(Ok(tour));
        }
Exemplo n.º 4
0
 public IEnumerable <FoodType> Get()
 {
     return(_service.Get());
 }