title: How to Specify Entity Framework Core Table Mapping?
body: <p>I've made a simple Entity Framework ASP Core Application that works but I do not know why:</p>
  <p>I've made a context like this:</p>
  <pre><code>public class AstootContext : DbContext
  {
      public AstootContext(DbContextOptions&lt;AstootContext&gt; options)
          : base(options)
      { }
  
      public DbSet&lt;Account&gt; Accounts { get; set; }
      public DbSet&lt;User&gt; Users { get; set; }
  }
  </code></pre>
  <p>And I have two tables with models like this:</p>
  <pre><code>public class Account
  {
      public int Id { get; set; }
      public string Username { get; set; }
      public string PasswordHash { get; set; }
      public DateTime Created { get; set; }
  
      List&lt;User&gt; Users { get; set; }
  }
  
  public class User
  {
      public int Id { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public string Email { get; set; }
      public DateTime Birthday { get; set; }
      public Account Account { get; set; }
  }
  </code></pre>
  <p>The interesting thing is that when I run my application it actually can pick up the data. It just seems weird because I have not specified any table mapping.
  I'm assuming this just automaps because the specified tables are the same name.</p>
  <p>My questions are:</p>
  <ol>
  <li><p>How do I specify Table explicit table mapping in case I do not want my model names to be exactly the same as the DB?</p>
  </li>
  <li><p>How do I specify Custom Column Mapping.</p>
  </li>
  <li><p>Is there anything special I have to specify for Primary/Foreign Keys</p>
  </li>
  </ol>
  <p><strong>edit</strong></p>
  <p>To clarify</p>
  <ol>
  <li><p>Say I had a table in the DB <code>MyAccounts</code> and I wanted to map that to an entity <code>Accounts</code>.</p>
  </li>
  <li><p>Say I had a column <code>password</code> and I wanted that to map to a POCO property <code>PasswordHash</code></p>
  </li>
  </ol>