public async Task <ActionResult <HotelDTO> > GetHotel(int id) { var hotel = await _hotels.GetHotelByID(id); if (hotel == null) { return(NotFound()); } return(hotel); }
// GET: Hotels/Details/5 public async Task <IActionResult> Details(int id) { if (id <= 0) { return(NotFound()); } var hotel = await _context.GetHotelByID(id); if (hotel == null) { return(NotFound()); } return(View(hotel)); }
public async Task <IActionResult> Results(int hotelId) { // List<Hotels> hotels = //query for all hotels here // return View(hotels); var result = await _hotel.GetHotelByID(hotelId); return(View(result)); }