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