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