public List <RoomDetails> FindRooms(HotelIdentifier hotel, DateTime startDate, DateTime endDate, string roomType) { using (var dbContext = new HotelContext()) { var hotelEntity = dbContext.Hotels.FirstOrDefault(h => h.Id == hotel.ID); if (hotelEntity != null) { return(FilterAvailableRooms(hotelEntity.RoomRelation, startDate, endDate, roomType) .Select(r => roomMapper.ToDetails(r)) .ToList()); } return(new List <RoomDetails>()); } }