Enumerable.Take
does do that automatically. Your code sample as given should work:
Take enumerates source and yields elements until count
elements have been yielded or source contains no more elements.
Enumerable.Take
does do that automatically. Your code sample as given should work:
Take enumerates source and yields elements until count
elements have been yielded or source contains no more elements.