The code for bulk insertion currently iterates through the items twice: once when counting them to determine batch size, and once when actually inserting them. This is more-or-less harmless for a List<T> datasource, but is problematic when you're generating items (as I was) via a yield return kind of construct. I don't think that there's any problem with having a batch size larger than the actual batch, so the simplest way to handle it was just to stop the first (counting) iteration.
The code for bulk insertion currently iterates through the items twice: once when counting them to determine batch size, and once when actually inserting them. This is more-or-less harmless for a
List<T>
datasource, but is problematic when you're generating items (as I was) via ayield return
kind of construct. I don't think that there's any problem with having a batch size larger than the actual batch, so the simplest way to handle it was just to stop the first (counting) iteration.