public void Rename(RenameCar command) { var car = _carRepository.Get(command.Id); car.Rename(command.Model); _carRepository.Save(); }
public async Task <CommandResult> Do(RenameCar command) { if (command.NewName == null) { return(new CommandResult(false, "Имя не может быть пустым!")); } await Emit(new CarRenamed(State.Id, command.NewName, State.Name)); return(CommandResult.Success); }
public void Rename([FromBody] RenameCar car) { _carApplication.Rename(car); }