public Task <bool> Handle(RemoveSalesCommand message, CancellationToken cancellationToken) { if (!message.IsValid()) { NotifyValidationErrors(message); return(Task.FromResult(false)); } _salesRepository.Remove(message.Id); if (Commit()) { Bus.RaiseEvent(new SalesRemovedEvent(message.Id)); } return(Task.FromResult(false)); }
public void Remove(Guid id) { var removeCommand = new RemoveSalesCommand(id); Bus.SendCommand(removeCommand); }