How can I get all types participating in a linq expression? I actually need this to be able to cache the query results.
In this example it is easy:
var Query = (from x in DataContext.Current.ContractDurations select x);
as
the type i need is provided in
Query.ElementType
But what happens when I do this:
var Query = (from x in DataContext.Current.ContractDurations select x.ID);
The ElementType will be int. The same problem will exist with joins where the ElementType will be some random anonymous type.
1 Answer