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