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; }
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(); }