public Task <bool> Handle(RemoveDriverCommand message, CancellationToken cancellationToken) { if (!message.IsValid()) { NotifyValidationErrors(message); return(Task.FromResult(false)); } _driverRepository.Remove(message.Id); if (Commit()) { Bus.RaiseEvent(new DriverRemovedEvent(message.Id)); } return(Task.FromResult(true)); }
public void Remove(Guid id) { var removeCommand = new RemoveDriverCommand(id); Bus.SendCommand(removeCommand); }