title: Invalid Object Name error when creating database with EF Code First
body: <p>Hello i am developing a database using <code>EF Core Code First</code>.I keep getting this error when generating the database :</p>
  
  <blockquote>
    <p>Microsoft.EntityFrameworkCore.DbUpdateException: 'An error occurred
    while updating the entries. See the inner exception for details.'</p>
    
    <ul>
    <li>InnerException  {"Invalid object name 'Parents'."}  System.Exception {Microsoft.Data.SqlClient.SqlException}</li>
    </ul>
  </blockquote>
  
  <p>From what i have read it seems i can not create the database because the tables are somehow pluralized.
  I have searched for solutions including this <a href="https://stackoverflow.com/questions/37493095/entity-framework-core-rc2-table-name-pluralization">SO thread</a> and tried the solutions  to no avail. The one that i have not tried is the <code>RemovePluralization</code> method because 
  I do not have this <code>Conventions</code> field in my <code>ModelBuilder</code> and i can not find the package containing it.</p>
  
  <p><strong>Context and Models</strong></p>
  
  <pre><code>          public class Parent {
              public int ID { get; set; }
              public string Name { get; set; }
              public ICollection&lt;Child&gt; Children { get; set; }
              public Parent() {
                  this.Children = new List&lt;Child&gt;();
              }
          }
  
          public class Child {
              public int ID { get; set; }
              public string Name { get; set; }
              public Parent Parent { get; set; }
              public int ParentId { get; set; }
          }
          public class MyContext : DbContext {
              public virtual DbSet&lt;Parent&gt; Parents { get; set; }
              public virtual DbSet&lt;Child&gt; Children { get; set; }
              protected override void OnModelCreating(ModelBuilder modelBuilder) {
                  base.OnModelCreating(modelBuilder);
                  modelBuilder.Entity&lt;Child&gt;()
                      .HasKey(x =&gt; x.ID);
                  modelBuilder.Entity&lt;Parent&gt;()
                      .HasKey(x =&gt; x.ID);
                  modelBuilder.Entity&lt;Parent&gt;()
                      .HasMany(x =&gt; x.Children)
                      .WithOne(k=&gt;k.Parent)
                      .HasForeignKey(t =&gt; t.ParentId);
  
              }
              public MyContext(DbContextOptions options):base(options) {
  
              this.Database.EnsureCreated();
              this.Database.Migrate(); //i have tried this too 
              }
        }
  </code></pre>
  
  <p><strong>Usage</strong></p>
  
  <pre><code>var optionsBuilder = new DbContextOptionsBuilder&lt;MyContext&gt;();
  optionsBuilder.UseSqlServer(connectionString);
  MyContext context = new MyContext(optionsBuilder.Options);
  Parent parent = new Parent() { Name = "Parentino" };
  context.Parents.Add(parent);
  await context.SaveChangesAsync(); //crashes with before mentioned error
  </code></pre>
  
  <p>I have also tried to set the table names in my <code>OnModelCreating</code> overload this:</p>
  
  <pre><code>modelBuilder.Entity&lt;Parent&gt;().ToTable("parent");
  </code></pre>
  
  <p>or directly with <code>[Table("name")]</code> attribute over my Model classes to no avail.</p>
  
  <p>Could someone help me out and tell me why i can't generate the database ?</p>