title: EF Designer Database first forces mapping to plural named tables
body: <p>I am doing Entity Frameworks Database first approach, using EF 5.0, visual studio 2012 and Sql server management studio. Both Vs and ssms are express version.</p>
  
  <p>I have several tables named ex. "User" or "Product", but when autogenerating the table mapping between an entity and a table, EF insists on mapping "User" to dbo.Users and "Product" to dbo.Products.</p>
  
  <p>I have tried setting tools->options->databasedesigner->O/R designer->Pluralization of names to false.</p>
  
  <p>When working with the *.edmx file in the EF designer in VS2012, I have also tried to set "Pluralize New Objects" to false.</p>
  
  <p>In the EF Designer it correctly shows that "User" maps to the "User" table, but when I inspect my dbcontext object in debugging mode during runtime and finds the sql it uses to access the tables it access dbo.Users.</p>
  
  <p>If I were using Code first approach this seems to be fixable by "modelBuilder.Conventions.Remove();" in the ModelBuilder, but how is this problem solved using the Database first approach?</p>
  
  <p>I should probably say that I use a IDbcontext for testing purpose</p>
  
  <pre><code>using System.Data.Entity.Infrastructure;
  
  namespace XX.Core
  {
      public interface IDbContext : IDisposable
      {
          IQueryable&lt;T&gt; Query&lt;T&gt;() where T : class;
  
          void Add&lt;T&gt;(T entity) where T : class;
  
          void Delete&lt;T&gt;(T entity) where T : class;
  
          void Update&lt;T&gt;(T entity) where T : class;
  
          Boolean Any&lt;T&gt;() where T : class;
  
          int SaveChanges();
  
          void Dispose();
      }
  }
  </code></pre>
  
  <p>and my actual dbcontext when not testing</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Data.Entity;
  
  namespace XX.Core.Model
  {
      public class XXDb : DbContext, IDbContext
      {
          public XXDb()
              : base("name=XX")
          {
  
          }
  
          public DbSet&lt;User&gt; Users { get; set; }
          public DbSet&lt;YY&gt; Products { get; set; }
          public DbSet&lt;Offer&gt; YY { get; set; }
          public DbSet&lt;ZZ&gt; ZZ { get; set; }
  
          IQueryable&lt;T&gt; IDbContext.Query&lt;T&gt;()
          {
              return Set&lt;T&gt;();
          }
  
          void IDbContext.Add&lt;T&gt;(T entity) 
          {
              Set&lt;T&gt;().Add(entity);
          }
  
          void IDbContext.Delete&lt;T&gt;(T entity) 
          {
              Set&lt;T&gt;().Remove(entity);
          }
  
          void IDbContext.Update&lt;T&gt;(T entity)        
          {
              Set&lt;T&gt;().Attach(entity); 
  
              SaveChanges();
          }
  
          Boolean IDbContext.Any&lt;T&gt;()
          {
              return Set&lt;T&gt;().Any();
          }
      }
  }
  </code></pre>