This file contains hidden or 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 class BatchLinq | |
{ | |
public static IEnumerable<IEnumerable<T>> Batch<T>(this IEnumerable<T> source, int size) | |
{ | |
if (size <= 0) | |
throw new ArgumentOutOfRangeException("size", "Must be greater than zero."); | |
using (IEnumerator<T> enumerator = source.GetEnumerator()) | |
while (enumerator.MoveNext()) | |
yield return TakeIEnumerator(enumerator, size); |
This file contains hidden or 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
<?xml?> | |
<nlog> | |
<targets><target name='debug' type='Debug' layout='${message}' /></targets> | |
<rules> | |
<logger name='*' minlevel='Debug' writeTo='debug' /> | |
</rules> | |
</nlog> |