We can write below code:
Func<string, string> func = x => x + x;
We also can write:
Expression<Func<string, string>> exp = x => x + x;
But when I write :
Expression<Func<string, string>> exp = func;
The compiler throw an error:
Cannot implicitly convert type 'System.Func' to 'System.Linq.Expressions.Expression>'
So I change the code as below:
Expression<Func<string, string>> exp = (Expression<Func<string, string>>)func;
Same error as before.
So what's the real type of x => x + x;
, what's the relation between Expression and Delegate/Lambda Expression?