Esempio n. 1
0
        public async Task <VehicleDto> AddAsync(VehicleDto dto)
        {
            var vehicle = VehicleMapper.toDomain(dto);

            await this._repo.AddAsync(vehicle);

            await this._unitOfWork.CommitAsync();

            return(VehicleMapper.toDTO(vehicle));
        }
Esempio n. 2
0
 public static Vehicle toDomain(VehicleDto dto)
 {
     return(new Vehicle(dto.LicensePlate, dto.VIN, new VehicleType(dto.Type), dto.ServiceAdmission));
 }