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)); }
public static Vehicle toDomain(VehicleDto dto) { return(new Vehicle(dto.LicensePlate, dto.VIN, new VehicleType(dto.Type), dto.ServiceAdmission)); }