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