title: EF Core: The LINQ expression could not be translated
body: <p>I am trying to implement a query in EF Core in which I need to get data where any name in  a string array is contained by the name of the data object. Here is the code sample:</p>
  
  <pre><code>            var searchKeys = search.Split(' ');
              var objects = _db.Objects
                  .Where(o =&gt; searchKeys.Any(k =&gt; o.name.Contains(k))))  
                  .OrderBy(o =&gt; o.Name)
                  .Select o
  </code></pre>
  
  <p>But the query cannot be translated resulting in the following error:</p>
  
  <blockquote>
    <p>The LINQ expression 'DbSet
            .Where(o => __searchKeys_1
                .Any(k => __Functions_2
                    .Contains(
                        _: o.Name, 
                        propertyReference: k)))' could not be translated. Either rewrite the query in a form that can be translated, or switch
    to client evaluation explicitly by inserting a call to either
    AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See
    <a href="https://go.microsoft.com/fwlink/?linkid=2101038" rel="nofollow noreferrer">https://go.microsoft.com/fwlink/?linkid=2101038</a> for more information.</p>
  </blockquote>
  
  <p>How can I contruct the query to fix the error? </p>