//ParkingPlaceRepository parkingPlaceRepository = new ParkingPlaceRepository(); public ParkingPlaceDTO ParkingPlaceToParkingPlaceDTO(ParkingPlace parkingPlace) { ParkingPlaceDTO parkingPlaceDTO = new ParkingPlaceDTO(); parkingPlaceDTO.Number = parkingPlace.Number; ParkingTicketMapper parkingTicketMapper = new ParkingTicketMapper(); parkingPlaceDTO.Ticket = parkingTicketMapper.ParkingTicketToParkingTicketDTO(parkingPlace.Ticket); return(parkingPlaceDTO); }
//CarRepository carRepository = new CarRepository(); public CarDTO CarToCarDTO(Car car) { CarDTO carDTO = new CarDTO(); carDTO.Name = car.Name; //carDTO.id = car.id; carDTO.Tickets = new List <ParkingTicketDTO>(); ParkingTicketMapper parkingTicketMapper = new ParkingTicketMapper(); foreach (var i in car.Tickets) { carDTO.Tickets.Add(parkingTicketMapper.ParkingTicketToParkingTicketDTO(i)); } return(carDTO); }
//ClientRepository clientRepository = new ClientRepository(); public ClientDTO ClientToClientDTO(Client client) { ClientDTO clientDTO = new ClientDTO(); clientDTO.Name = client.Name; //clientDTO.id = client.id; clientDTO.Tickets = new List <ParkingTicketDTO>(); ParkingTicketMapper parkingTicketMapper = new ParkingTicketMapper(); //foreach (var i in client.Tickets) //{ // clientDTO.Tickets.Add(parkingTicketMapper.ParkingTicketToParkingTicketDTO(i)); //} return(clientDTO); }
//ParkingRepository parkingRepository = new ParkingRepository(); public ParkingDTO ParkingToParkingDTO(Parking parking) { ParkingDTO parkingDTO = new ParkingDTO(); parkingDTO.ParkingName = parking.ParkingName; //parkingDTO.id = parking.id; parkingDTO.Tickets = new List <ParkingTicketDTO>(); parkingDTO.Places = new List <ParkingPlaceDTO>(); ParkingTicketMapper parkingTicketMapper = new ParkingTicketMapper(); ParkingPlaceMapper parkingPlaceMapper = new ParkingPlaceMapper(); foreach (var i in parking.Tickets) { parkingDTO.Tickets.Add(parkingTicketMapper.ParkingTicketToParkingTicketDTO(i)); } foreach (var i in parking.Places) { parkingDTO.Places.Add(parkingPlaceMapper.ParkingPlaceToParkingPlaceDTO(i)); } return(parkingDTO); }