How to check an IEnumerable for multiple conditions with a single enumeration without buffering?
问题 I have a very long sequence of data is the form of IEnumerable , and I would like to check it for a number of conditions. Each condition returns a value of true or false, and I want to know if all conditions are true. My problem is that I can not afford to materialize the IEnumerable by calling ToList , because it is simply too long (> 10,000,000,000 elements). Neither I can afford to enumerate the sequence multiple times, one for each condition, because each time I will get a different