In response to a very interesting question by Jason Kealy on StackOverflow (Get an IDataReader from a typed List), I spiked out a fairly complete and tested implementation of IDataReader of IEnumerable and IEnumerable<T> that includes support for anonymous types making it possible to push Linq IQueryables containing anonymous types into an IDataReader.
The use case was performing a bulk insert from an in memory List. Apparently the implementation works well for this so I decided to fold it into my libs and post about it here as well.
You can find runnable source in the anwser on StackOverflow but due to the post size limitations I removed most of the tests and xml doc comments.
You can find The full project with tests and updated source at my codeplex spikes project.
Technorati tags:
Outside the box,
Data