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