Is there a way to eliminate the repetition in this linq query?
Apply the common refactoring used for repeated code: extracting a method. In your case, creating the method won't be trivial, because you want to create a different Expression each time. That is, unless you use LINQKit:

public static IQueryable&lt;T&gt; WhereEqualsByPatIndex&lt;T&gt;(
    this IQueryable&lt;T&gt; query, string value, Expression&lt;Func&lt;T, string&gt;&gt; propertyExpression)
{
    if (string.IsNullOrEmpty(value))
        return query;

   return query.Where(
       ex =&gt; SqlFunctions.PatIndex(
           value.Trim(), propertyExpression.Invoke(ex, propertyExpression).Trim()) &gt; 0);
}


Usage would be like this (that call to AsExpandable() is important):

dc.Retailers
  .AsExpandable()
  .WhereEqualsByPatIndex(firstName, ex =&gt; ex.FirstName)
  .WhereEqualsByPatIndex(lastName, ex =&gt; ex.LastName)