title: EF Core Find method equivalent for multiple records?
body: <p>EF Core's <code>DbSet</code> has a method called <a href="https://docs.microsoft.com/en-us/ef/core/api/microsoft.entityframeworkcore.dbset-1" rel="noreferrer"><code>Find</code></a> that:</p>
  
  <blockquote>
    <p>Finds an entity with the given primary key values. If an entity with
    the given primary key values is being tracked by the context, then it
    is returned immediately without making a request to the database.
    Otherwise, a query is made to the dataabse for an entity with the
    given primary key values and this entity, if found, is attached to the
    context and returned. If no entity is found, then null is returned.</p>
  </blockquote>
  
  <p>I need to return multiple items based on the given array of primary key values, all in one request of course. Is there a method to do that in EF Core?</p>
  
  <p><strong>Update</strong>: I know I can use <code>Where</code> clause in normal scenarios. But I'm creating a helper utility that is generic, and in it I have no access to strongly-typed properties of my model. Thus I can't use <code>Where(x =&gt; ids.Contains(x.Id))</code> clause.</p>
  
  <p><strong>Update 2</strong>: The desirable method can have a simple signature that gets a list of <code>long</code> values, and returns a list of <code>T</code>. <code>public static List&lt;T&gt; FindSet(List&lt;long&gt; ids)</code> that can be used like this:</p>
  
  <pre><code>var foundRecords = dbset.FindSet(new List&lt;long&gt; { 5, 17, 93, 178, 15400 });
  </code></pre>