コード例 #1
0
 public ReservationResponseModel(Reservation reservation)
 {
     this.Id = reservation.Id;
     this.DateOfReservation = reservation.DateOfReservation;
     this.Title = reservation.Destination.Title;
     this.Price = reservation.Destination.Price;
     this.Location = reservation.Destination.Location.Name;
 }
コード例 #2
0
 public void CreateReservation(string userId, int destinationId)
 {
     var reservationToAdd = new Reservation
     {
         UserId = userId,
         DestinationId = destinationId,
         DateOfReservation = DateTime.Now
     };
     this.reservations.Add(reservationToAdd);
     this.reservations.SaveChanges();
 }