title: Stuck with BinaryExpression in C#
body: <p>I want to implement</p>
  
  <pre><code>Expression&lt;Func&lt;int, int, int&gt;&gt; Max = (p1,p2) =&gt; p1 &gt; p2 ? p1:p2;
  </code></pre>
  
  <p>as an expression tree and tried</p>
  
  <pre><code>ParameterExpression LeftEx = Expression.Parameter(typeof(int), "p1");
  ParameterExpression RightEx = Expression.Parameter(typeof(int), "p2");
  BinaryExpression GroesserAls =  Expression.GreaterThan(LeftEx, RightEx);
  ConditionalExpression Cond = BinaryExpression.Condition(GroesserAls, LeftEx, RightEx);
  Expression main = Cond.Test;
  Expression&lt;Func&lt;int, int, bool&gt;&gt; Lam = Expression.Lambda&lt;Func&lt;int, int, bool&gt;&gt;(main,
    new ParameterExpression[] { LeftEx, RightEx });
  Console.WriteLine(Lam.Compile().Invoke(333, 1200));
  </code></pre>
  
  <p>With Cond I either get true/false but not the LeftEx or RightEx that Condition should return.</p>
  
  <p>I couldn't find anything in the documentation.</p>
  
  <p>peter</p>