title: Why am I getting an InvalidCastException when using an expression from a static field?
body: <p>I'm just starting to use <a href="http://www.nuget.org/packages/LinqKit/" rel="nofollow">LinqKit</a> with EntityFramework 6.0.2 and I have the following question...</p>
  
  <p>Why does this:</p>
  
  <pre><code>public static readonly Expression&lt;Func&lt;MyEnum, string&gt;&gt; ConvertToString = e =&gt; 
          e == MyEnum.One
                      ? "one"
                      : e == MyEnum.Two
                          ? "two"
                          : "zero";
  
  private static string GetSomethingElse(IQueryable&lt;EnumTest&gt; things)
  {           
      var ret = things
          .AsExpandable()
          .Select(c =&gt; Program.ConvertToString.Invoke(c.SomeEnum))
          .First();
      return ret;
  }
  </code></pre>
  
  <p>throw:</p>
  
  <pre><code>An unhandled exception of type 'System.InvalidCastException' 
      occurred in LinqKit.dll
  
  Additional information: Unable to cast object of type     
      'System.Linq.Expressions.FieldExpression' to type 
      'System.Linq.Expressions.LambdaExpression'.
  </code></pre>
  
  <p>but this:</p>
  
  <pre><code>private static string GetSomething(IQueryable&lt;EnumTest&gt; things)
  {
      Expression&lt;Func&lt;MyEnum, string&gt;&gt; ConvertToString = e =&gt; e == MyEnum.One
          ? "one"
          : e == MyEnum.Two
              ? "two"
              : "zero";
  
      var ret = things
          .AsExpandable()
          .Select(c =&gt; ConvertToString.Invoke(c.SomeEnum))
          .First();
      return ret;
  }
  </code></pre>
  
  <p>works fine?</p>