public Task <bool> Handle(RemoveSellerCommand request, CancellationToken cancellationToken) { if (!request.IsValid()) { NotifyValidationErrors(request); return(Task.FromResult(false)); } _sellerRepository.Remove(request.SellerId); if (Commit()) { _bus.RaiseEvent(new SellerRemovedEvent(request.SellerId)); } return(Task.FromResult(true)); }
public void Remove(int id) { var removeCommand = new RemoveSellerCommand(id); Bus.SendCommand(removeCommand); }