title: Entity Framework, LINQ: can't use Any with StartsWith?
body: <p>I have a simple Entity Framework LINQ query.  The goal is to find all the Carriers that start with A, B, or C:</p>
  <pre><code>var letters = new List&lt;string&gt;() { &quot;A&quot;, &quot;B&quot;, &quot;C&quot; }; // Dynamic, can be many
  var results = db.Carriers.AsNoTracking()
      .Where(c =&gt; letters.Any(val =&gt; c.Name.StartsWith(val)))
      .ToList();
  </code></pre>
  <p>I get</p>
  <blockquote>
  <p>System.InvalidOperationException: 'The LINQ expression 'DbSet
  .Where(c =&gt; __letters_0
  .Any(val =&gt; val == &quot;&quot; || c.Name != null &amp;&amp; val != null &amp;&amp; c.Name.StartsWith(val)))' 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>Is there no way to do this?</p>