I have tried and is like EF4 CTP5 is totally ignoring it. What can be wrong?
using section:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.ModelConfiguration.Conventions.Edm;
DbContext:
public class SiteDataContext : DbContext
{
public DbSet<Blog> Blogs { get; set; }
public DbSet<BlogFeedback> BlogFeedbacks { get; set; }
public DbSet<BlogCategoryList> BlogCategoryLists { get; set; }
public DbSet<BlogCategory> BlogCategories { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingEntitySetNameConvention>();
base.OnModelCreating(modelBuilder);
}
}
POCO classes
public class Blog
{...}
public class BlogFeedback
{...}
public class BlogCategoryList
{...}
public class BlogCategory
{...}
Tables generated:
Blogs
BlogCategories
BlogCategoryLists
BlogFeedbacks
What I need:
Blog
BlogCategory
BlogCategoryList
BlogFeedback
One thing may be different is I split my solution into two projects Core and Web. Core has Models, Services and all Code First. Web has only Controllers and Views and a reference to Core. The SetInitializer().Seed() is inside a function in Core, and in Web global.asax the Core.SetInitializer is called, so keep all CTP5 functions inside Core. Database is being recreated ok, data is filled ok, just the convention keeps PLURAL TABLE NAMES, ignoring the modelBuilder override