title: Entity Framework - CTP4 - Code First - How to turn off the automatic pluralization?
body: <p>My entity name is &quot;Contact&quot; and my table name is &quot;Contact&quot;. However, the default pluralization support is making EF4 to look for a table named &quot;Contacts&quot;. Anybody has any idea on how to turn off the pluralization support?</p>
  <p><a href="https://web.archive.org/web/20151228050246/http://blogs.msdn.com:80/b/efdesign/archive/2008/12/02/pluralization.aspx" rel="nofollow noreferrer">This</a> post has got some details on pluralization support. But still does not give me an answer.</p>
  <p>I see the following text in <a href="https://web.archive.org/web/20160725001626/http://www.olegsych.com:80/2009/12/simplifying-entity-framework-data-driven-design/" rel="nofollow noreferrer">this</a> post. First of all, I dont know which physical .tt file I need to make this change. Also, I want to have this feature turned off only for one app and not for all.</p>
  <blockquote>
  <p>The code generator in T4 Toolbox has
  the pluralization turned on by default
  in Visual Studio 2010. If you need to
  generate the DAL without
  pluralization, perhaps for
  compatibility reasons, you can turn
  this option off by adding the
  following line to the .tt file before
  generator.Run() method is called.</p>
  <p>C#<br />
  generator.Pluralize = false;</p>
  </blockquote>
  <blockquote>
  <p>VB<br />
  generator.Pluralize = False</p>
  </blockquote>
  <p><em><strong><strong>UPDATE</strong></strong></em></p>
  <p>Following is the code I use and I get an error given below:-</p>
  <p>Contact</p>
  <pre><code> public class Contact
   {
   public int ContactID { get; set; }
   public string FirstName { get; set; }
   public string LastName { get; set; }
   public string Title { get; set; }
   public DateTime AddDate { get; set; }
   public DateTime ModifiedDate { get; set; }
   }
  </code></pre>
  <p>Context:-</p>
  <pre><code> public class AddressBook : DbContext
   {
   public DbSet&lt;Contact&gt; Contact { get; set; }
  
   protected override void OnModelCreating(ModelBuilder modelBuilder)
   {
    modelBuilder.Entity&lt;Contact&gt;().MapSingleType().ToTable(&quot;dbo.Contact&quot;);
   }
  </code></pre>
  <p>}</p>
  <p>The main program:-</p>
  <pre><code>using (var context = new AddressBook())
    {
     var contact = new Contact
     {
     ContactID = 10000,
     FirstName = &quot;Brian&quot;,
     LastName = &quot;Lara&quot;,
     ModifiedDate = DateTime.Now,
     AddDate = DateTime.Now,
     Title = &quot;Mr.&quot;
  
     };
     context.Contact.Add(contact);
     int result = context.SaveChanges();
     Console.WriteLine(&quot;Result :- &quot; + result.ToString());
  
    }
  </code></pre>
  <p>And I get the following error on &quot;context.Contact.Add(contact);&quot;:-</p>
  <blockquote>
  <p>System.InvalidOperationException: The
  model backing the 'AddressBook'
  context has changed since the database
  was created.  Either manually
  delete/update the database, or call
  Database.SetInitializer with an
  IDatabaseInitializer instance.  For
  example, the
  RecreateDatabaseIfModelChanges
  strategy will automatically delete and
  recreate the database, and optionally
  seed it with new data.   at
  System.Data.Entity.Infrastructure.CreateDatabaseOnlyIfNotExists<code>1.InitializeDatabase(TContext context)   at System.Data.Entity.Infrastructure.Database.Initialize() at System.Data.Entity.Internal.InternalContext.Initialize() at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)   at System.Data.Entity.Internal.Linq.EfInternalQuery</code>1.Initialize()
  at
  System.Data.Entity.DbSet<code>1.ActOnSet(Action action,EntityState newState, TEntity entity)   at System.Data.Entity.DbSet</code>1.Add(TEntity
  entity)   at
  CodeFirst.Client.Program.Main(String[]
  args) in E:\Ashish\Research\VS
  Solutions\EntityFramework\CodeFirstApproach_EF_CTP4\CodeFirst.Client\Program.cs:line 35</p>
  </blockquote>
  <p>I am sure I am making a stupid mistake somewhere, just unable to figure out. Could somebody please provide some directions?</p>
  <p><strong>ANSWER</strong>
  With Pault's help I described this problem and the solution <a href="https://guptaashish.com/2010/09/07/entity-framework-ctp4-%E2%80%93-code-first-%E2%80%93-map-your-poco-entities-to-different-table/" rel="nofollow noreferrer">here</a>.</p>