title: Build an Expression Tree with multiple parameters
body: <p>I am trying to create a method that can accept multiple property names and a string value that will be use to research in entity possessing those properties </p>
  
  <p>I want to a generic method to replace this one:</p>
  
  <pre><code>    public static Client[] GetClientByInfo(string info)
      {
          return Context.Db.Clients.Where(c =&gt;
              c.LastName.Contains(info) ||
              c.FirstName.Contains(info)).ToArray();
      }
  </code></pre>
  
  <p>So I tried this:</p>
  
  <pre><code>    public static T[] FindByText&lt;T&gt;(string text, string[] properties)
          where T: class
      {
          return Context.Db.Set&lt;T&gt;().AsNoTracking().Where(PropertyEquals&lt;T, string&gt;(properties, text)).ToArray();
      }
  
      public static Expression&lt;Func&lt;TItem, bool&gt;&gt; PropertyEquals&lt;TItem, TValue&gt;(string[] properties, TValue value)
      {
          MethodInfo startWithMethod = typeof(string).GetMethod("StartsWith", BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(string) }, null);
          ParameterExpression parameter = Expression.Parameter(typeof(TItem));
          ConstantExpression constant = Expression.Constant(value, typeof(TValue));
          MemberExpression[] members = new MemberExpression[properties.Length];
          for (int i = 0; i &lt; properties.Length; i++)
              members[i] = Expression.Property(parameter, properties[i]);
  
          MethodCallExpression callExp = Expression.Call(parameter, startWithMethod, members);
  
          return Expression.Lambda&lt;Func&lt;TItem, bool&gt;&gt;(callExp, parameter);
      }
  </code></pre>
  
  <p>I do something wrong when I call Expression.Call
  Is it possible to build an expression like this or i must use concatenate expression?</p>