title: How to use Find(params object[] keyValues) method on a DbSet instance in ASP.NET Core?
body: <p>I am currently migrating an ASP.NET webform into ASP.NET Core. I have a small issue with a specific Find method. I am quite new to .NET so I hope that the code would explain it better.</p>
  
  <pre><code>var env = Request.Headers.GetValues("environment").First();
  var db = new FormsContext(env);
  var request = db.InfoRequests.Find(Convert.ToInt32(id));
  </code></pre>
  
  <p>I am specifically trying to find a replacement for <code>Find(Convert.ToInt32(id))</code>; part of the code where "id" comes in as a string to the method.</p>
  
  <p>To be more specific, in .NET Core they removed System.Data.Entity and this find method used to come from there. (This is from ASP.NET, not .NET Core)</p>
  
  <pre><code>System.Data.Entity.DbSet&lt;InfoRequest&gt;.Find(params object[] keyValues);
  </code></pre>
  
  <p>however the DbSet method that I am using now is from following: (This one is from .NET Core)</p>
  
  <pre><code>Microsoft.EntityFrameworkCore.DbSet&lt;InfoRequest&gt;
  </code></pre>
  
  <p>but this class does not have a find method that I can use. Or I am unaware of the syntax.</p>
  
  <p>Lastly, a small snippet from how "InfoRequest" class is created:</p>
  
  <pre><code>public partial class FormsContext : DbContext
  {
      ...
      public virtual DbSet&lt;InfoRequest&gt; InfoRequests { get; set; }
      ...
  }
  </code></pre>
  
  <p>I hope I was able to provide enough information, but shortly, I am trying to find a replacement in .NET Core for the "find" method. Or if you can replace the three lines that I have first shared with an alternative, that should suffice as well. Thanks.</p>