Пример #1
0
 public static ParkingLot MapTo(ParkingLotVM parkingLotVM)
 {
     return(new ParkingLot
     {
         ParkingID = parkingLotVM.ParkingID,
         ParkingName = parkingLotVM.ParkingName,
         Capacity = parkingLotVM.Capacity,
         Zone = (int?)parkingLotVM.Zone
     });
 }
Пример #2
0
        public static Reservation MapTo(ReservationVM reservationVM)
        {
            return(new Reservation
            {
                ReservationID = reservationVM.ReservationID,
                CustomerID = reservationVM.CustomerID,
                ParkingID = reservationVM.ParkingID,
                StartDate = reservationVM.StartDate,
                EndDate = reservationVM.EndDate,

                Customer = CustomerVM.MapTo(reservationVM.Customer),
                ParkingLot = ParkingLotVM.MapTo(reservationVM.ParkingLot)
            });
        }