title: How to add additional lambda expression to IQueryable CreateQuery
body: <p>Here is my original select query which works for one field "SurveyName":</p>
  
  <pre><code>    public static IQueryable Select(this IQueryable source, string selector, params object[] values)
      {
          LambdaExpression lambda = DynamicExpression.ParseLambda(source.ElementType, null, "SurveyName", values); //SurveyName is hard coded here as example
          return source.Provider.CreateQuery(
              Expression.Call(
                  typeof(Queryable), "Select",
                  new Type[] { source.ElementType, lambda.Body.Type },
                  source.Expression, Expression.Quote(lambda)));
      }
  </code></pre>
  
  <p>I want to add second lambda expression and I tried below:</p>
  
  <pre><code>    public static IQueryable Select(this IQueryable source, string selector, params object[] values)
      {
          LambdaExpression lambda = DynamicExpression.ParseLambda(source.ElementType, null, "SurveyName", values); //SurveyName is hard coded as example
          LambdaExpression lambda2 = DynamicExpression.ParseLambda(source.ElementType, null, "SurveyHeaderName", values); //SurveyHeaderName is hard coded as example
  
          return source.Provider.CreateQuery(
              Expression.Call(
                  typeof(Queryable), "Select",
                  new Type[] { source.ElementType, lambda.Body.Type, lambda2.Body.Type },
                  source.Expression, Expression.Quote(lambda)));
      }
  </code></pre>
  
  <p>Which give me </p>
  
  <blockquote>
    <p>No generic method 'Select' on type 'System.Linq.Queryable' is
    compatible with the supplied type arguments and arguments. No type
    arguments should be provided if the method is non-generic</p>
  </blockquote>
  
  <p>How to achieve add additional lambda expression (I mean additional field <code>Select SurveyName, SurveyHeaderName</code>)</p>
  
  <p>Hear is "lambda" screen shot in debug</p>
  
  <p><a href="https://i.stack.imgur.com/H5HtU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H5HtU.png" alt="enter image description here"></a></p>
  
  <p>As giving more details, why I use above code, here is frontend part:</p>
  
  <pre><code>public class SurveyQuestionSurveyHeaderSurvey
  {
      public SurveyQuestion SurveyQuestion { get; set; }
      public SurveyHeader SurveyHeader { get; set; }
      public Survey Survey { get; set; }
  
      public String SurveyName { get; set; }
      public String SurveyHeaderName { get; set; }
  }
  
  public IEnumerable&lt;SurveyQuestionReportViewModel&gt; SurveyQuestionReportExcel(IDataTablesRequest dataTablesRequest, out int totalCount)
  {
      var res0 = from sq in _uow.Repository&lt;SurveyQuestion&gt;().Queryable()
                 join s in _uow.Repository&lt;Survey&gt;().Queryable()
                 on sq.SurveyHeader.SurveyId equals s.SurveyId
                 select new SurveyQuestionSurveyHeaderSurvey { SurveyQuestion = sq, Survey = s, SurveyHeader = sq.SurveyHeader, SurveyName = s.Name };
  
  
      List&lt;Expression&lt;Func&lt;object, bool&gt;&gt;&gt; _expression;
      List&lt;Expression&lt;Func&lt;object, object&gt;&gt;&gt; _includes;
  
      _includes = new List&lt;Expression&lt;Func&lt;object, object&gt;&gt;&gt;();
      _expression = new List&lt;Expression&lt;Func&lt;object, bool&gt;&gt;&gt;();
      Func&lt;IQueryable&lt;object&gt;, IOrderedQueryable&lt;object&gt;&gt; _orderBy;
  
      if (dataTablesRequest.GetSearchListParameter() != null)
          _expression.Add(DynamicQueryable.WhereLambdaExpression&lt;object&gt;(dataTablesRequest.GetSearchListParameter()));
  
      if (dataTablesRequest.GetOrderByParameter() != null)
          _orderBy = p =&gt; p.OrderBy(dataTablesRequest.GetOrderByParameter());
      else
          _orderBy = p =&gt; p.OrderBy("ID Desc");
  
      var fields = String.Join(",", dataTablesRequest.Columns.Select(x =&gt; x.Data).ToArray()).TrimEnd(',');
      fields = "SurveyName";
      var toto = res0.Select(fields, null, _expression, _orderBy, _includes, dataTablesRequest.Start, dataTablesRequest.Length);
  
  
      var result = res0.Include(p =&gt; p.SurveyHeader.Survey).Where(x =&gt; x.SurveyHeader.SurveyId == 3074)
         .Select(x =&gt; new SurveyQuestionReportViewModel
         {
             SurveyQuestionId = x.SurveyQuestion.SurveyQuestionId,
             SurveyName = x.SurveyHeader.Survey.Name,
             Name = "Genel Sonuç",
             HeaderName = x.SurveyHeader.Name,
             QuestionName = x.SurveyQuestion.Description,
         });
      totalCount = 10;
      return result;
  
  }
  </code></pre>