Expression<Func<int, string>> e = i => i.ToString() |
and
Func<int, string> f = i => i.ToString() |
I think it would be very helpful to have a way to get the Func<,> delegate for a given Expression<Func<,>>
Easiest way would be by an implicit conversion
f = e; |
I understand it is the job of the compiler to generate either the Expression or the Func and I saw the Espresso sample in the LINQ preview where a pretty elaborated parser has been created in order to do so.
As the sample shows, there is obviously the need for that kind of conversion and look forward to see a more standard approach to do so.

Expression<Func<A,R>> to Func<A,R> conversion
StephenMas
RomanG
Were expression trees something of limited usefulness outside of Linq, I think I wouldn't care. However, such trees could see use in computer algebra systems, scripting languages, etc. Particularly if the CodeDOM parsers can start outputting expression trees, or if the trees can be convertable from CodeDOM trees (which I think you'll have to involve at some point in this conversion effort, anyway). These may easily involve languages that don't know about extension methods.
windsamurai
As I stated before, I saw it.
I hoped it would be part of the LINQ project itself, either compiler generated, provided by an extension method or conversion operator on Expression, ...
Vassilux