public async Task HandleAsync(EditVehicleGallery command) { var car = await _carService.GetAsync(command.Car.ID); if (command.Images != null && car != null) { AddImageToCar.Add(_hostingEnvironment, command.Images, car); } await _carService.Update(car); }
public async Task HandleAsync(AddVehicle command) { if (command.Images != null) { AddImageToCar.Add(_hostingEnvironment, command.Images, command.Car); } if (!command.Car.Milage.Contains("km")) { command.Car.Milage += " km"; } if (!command.Car.Power.Contains("KM")) { command.Car.Power += " KM"; } await _carService.AddAsync(command.Car); }