title: Entity Framework save class without an Id from external source
body: <p>Given a class from an external source (in my case a NuGet Package):</p>
  
  <pre><code>public class Apple {
      // Some properties
  }
  </code></pre>
  
  <p>What is the best method to store this in a <code>dbContext</code>?</p>
  
  <p>Note that I cannot use the following since Apple does not have an Id:</p>
  
  <pre><code>DbSet&lt;Apple&gt; Apples {get; set;}
  </code></pre>
  
  <p>Right now my (naive) solution is to have mapper functions to store a similar class in the database I that have created, and then call these when I want to access an object from the NuGet Package. </p>
  
  <p>Thank you for any advice!</p>