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)); }
public IActionResult GetFoodType(int id) { try { return(Ok(_foodTypeService.Get(id).ToApiModel())); } catch (Exception ex) { ModelState.AddModelError("UpdateItem", ex.Message); return(BadRequest(ModelState)); } }
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)); }
public IEnumerable <FoodType> Get() { return(_service.Get()); }