Created
January 22, 2013 17:23
-
-
Save DTTerastar/4596445 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<T> Unpage<T>(Func<int, int, IEnumerable<T>> func, int batchSize) | |
{ | |
int skip = 0; | |
int count; | |
do | |
{ | |
count = 0; | |
foreach (var a in func(skip, batchSize)) | |
{ | |
count++; | |
yield return a; | |
} | |
skip += batchSize; | |
} while (count == batchSize); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment