Frequently one wants to display the complete result of simple joins of database tables:
from x in tablex
join y in tabley on x.id equals y.id
select new { x, y }
The result of that, however, is not what you get with the equivalent SQL statement:
SELECT * FROM tablex x JOIN tabley y ON x.id = y.id
The SQL gives me one result table with all the columns from both tables, while LinqPad will return a table with only two columns, a click to each is needed to expand the respective objects.
Is there a simple way to get the same output I get from the analogous SQL in LinqPad?
You can get all object fields/properties using Reflection and fill them into one System.Dynamic.ExpandoObject
Here is simple extension method doing this: LINQPad script
or