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