I've got a generic<> function that takes a linq query ('items') and enumerates through it adding additional properties. How can I select all the properties of the original 'item' rather than the item itself (as the code below does)?
So equivalent to the sql: select *, 'bar' as Foo from items
foreach (var item in items)
{
var newItem = new {
item, // I'd like just the properties here, not the 'item' object!
Foo = "bar"
};
newItems.Add(newItem);
}