If you executed your application earlier and your model remains the same, the database already exists and OnModelCreating() will not be called.
You can use Database.SetInitializer()
static void Main(string[] args) { Database.SetInitializer( new DropCreateDatabaseIfModelChanges<YourContext>());
I also noticed that you are using FluentAPI, and I want to indicate that you can also use attributes for mappings:
[Table("dfg_Product")] public class Product
Hope this helps.
EDIT:
You are using
modelBuilder.Entity<Product>().ToTable("dfg_Product");
and that is why he created dbo.Product. Use
modelBuilder.Entity<Product>().MapSingleType().ToTable("dfg_Product");
and use DropCreateDatabaseAlways() to get the new database with the correct mappings.
EDIT 2
You do not need metadata information in the connection string when developing the Code First application, so your connection string should look like this:
<add name="DataModelContainer" connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=TestDB;integrated security=True;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
source share