コード例 #1
0
        public GetReservationDto ReservationToGetReservationDto(Reservation reservation)
        {
            var status = AssignStatus(reservation.StartDate, reservation.EndDate);

            return(new GetReservationDto
            {
                Id = reservation.Id,
                Balance = reservation.Balance,
                StartDate = reservation.StartDate,
                EndDate = reservation.EndDate,
                Status = status,
                Paid = reservation.IsPaid,
                Room = _roomConverter.RoomToGetRoomDto(reservation.Room),
                Client = _clientConverter.ClientToGetClientDto(reservation.Client)
            });
        }
コード例 #2
0
        public async Task <List <GetRoomDto> > FilterRoomsAsync(FilterRoomDto filterRoomDto)
        {
            var filteredRooms = await _repository.FilterAsync(filterRoomDto);

            return(filteredRooms.Select(r => _converter.RoomToGetRoomDto(r)).ToList());
        }