title: Using PredicateBuilder to build query searching across multiple columns of Entity
body: <p>I have a list of field names. I am trying to build a predicate to look in the fields to see if they contain the search term. I have gone done the path listed in this <a href="https://stackoverflow.com/questions/14656600/using-predicatebuilder-is-there-a-way-to-build-a-predicate-off-of-a-variable-len">original question</a> but do not understand how to do a <strong>Contains</strong> instead of a <strong>NotEqual</strong>.</p>
  
  <pre><code>string searchTerm = "Fred";    
  foreach (var field in FieldNames)
  {
      myPredicate= myPredicate.And(m =&gt; m.*field*.Contains(searchTerm));                    
  } 
  </code></pre>
  
  <p>My code so far:</p>
  
  <pre><code>public static Expression&lt;Func&lt;T, bool&gt;&gt; MultiColumnSearchExpression&lt;T&gt;(string fieldName,string searchValue)
  {
      var parameter = Expression.Parameter(typeof(T), "m");
      var fieldAccess = Expression.PropertyOrField(parameter, fieldName);
     //this next line should do a Contains rather then NotEqual but how?
      var body = Expression.NotEqual(fieldAccess, nullValue);
  
      var expr = Expression.Lambda&lt;Func&lt;T, bool&gt;&gt;(body, parameter);
      return expr;
  }
  </code></pre>