public Task Handle(RemoverPerfilCommand message, CancellationToken cancellationToken) { if (!message.IsValid()) { NotifyValidationErrors(message); return(Task.CompletedTask); } _perfilRepository.Remove(message.Id); if (Commit()) { Bus.RaiseEvent(new PerfilRemovedEvents(message.Id)); return(Task.CompletedTask); } return(Task.CompletedTask); }
public void Remove(Guid id) { var removeCommand = new RemoverPerfilCommand(id); _bus.SendCommand(removeCommand); }