I work with a lot of Linq queries in my code, and I'm looking for a library that provides a formatted Dump()
function similar to what LinqPad offers. LinqPad's Dump()
extension method is really quite nice, because it handles nested collections very well.
Ideally, it would print out pretty tables in plain text, but I'd be ok with spitting out HTML or other nicely formatted data.
The ObjectDumper sample from VS does not cut it at all.
This is what I've been using:
Special thanks to this thread (especially Pat Kujawa's & anunay's comments)
C# (Straight from Pat Kujawa's comment (though I made it return itself so that it chains like linqpad's version does)):
VB (my conversion since I needed it in a VB app):
You will need to add the linqpad executable as a reference in your project as well as
System.IO
andSystem.Diagnostics
This launches your default web browser showing the exact output that linqpad would generate.