Sem*_*ike 11 c# expression-trees linq-to-sql
我想在另一个中使用表达式:
Expression<Func<double, double>> f = x => x * x * 27 + blah ... expression with x;
Expression<Func<double, double>> g = y => 3 + 8 * f.Compile()(y) * y * blah... expression with y and f(y);
Run Code Online (Sandbox Code Playgroud)
这在发送到LINQ to SQL时不起作用,因为SQL不知道f.Compile().
如何f在y不编译变量的情况下评估变量上的表达式,但仍然使用常规语法来定义g?
我不想g用一些不可读Expression.Add/ Expression.Multiply等语句定义所有内容.
谢谢.