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