title: Mapping inheritance in EntityFramework Core
body: <p>I'm using EntityFramework Core, Code First and Fluent Api to define model database, and i've follow situation about strategy of map inheritance:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public class Person
  {
      public int Id { get; set; }
      public string Name { get; set; }
  }
  
  public class User : Person
  {
      public string UserName { get; set; }
      public string Password { get; set; }
  }
  
  public class Employee : Person
  {
      public decimal Salary { get; set; }
  }
  
  public class Customer:Person
  {
      public long DiscountPoints { get; set; }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>Business logical</strong></p>
  
  <p>In this case, users, employees and customers are people, however employees and customers are also users, as well as an employees can become a customer. And each type is used in distinct appication contexts.</p>
  
  <p>I implemented this way to not use values from other application contexts unnecessarily.</p>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li><p>What are the best practice to map a database model? Type-Per-Hyerarchy or Table-Per-Type? Considering that for many, <em>TPT is generally an anti-pattern and results in significant performance issues later on.</em> according <a href="https://github.com/aspnet/EntityFramework/issues/2266" rel="nofollow">EF issues #2266</a></p>
  
  <p>a. If TPH, how to use discriminator field to many types?</p>
  
  <p>b. If TPT, how to use this strategy in the EF Core 1.0?</p></li>
  <li>Is it the best architecture for the business model?</li>
  </ol>
  
  <p>thank you for your attention and collaboration</p>