0

I notice that I can do:

private static Func<int, int> foo = x => x + 1;
private static Expression<Func<int, int>> bar = x => x + 1;

But I cannot do an implicit cast:

private static Expression<Func<int, int>> baz = foo;  // won't compile

In C#, is there a way to create an Expression from a delegate (from a Func)?

Patrick Szalapski
  • 8,738
  • 11
  • 67
  • 129

0 Answers0