1.SQL Server
<add name="DBEntities" connectionString="Data Source=.;Initial Catalog=DB;Integrated Security=SSPI;User ID=sa;Password=tianxiang" providerName="System.Data.SqlClient" />
2.LocalDb .mdf
<add name="DBEntities" connectionString="Data Source=(LocalDb)v11.0;AttachDBFilename=|DataDirectory|DB.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
//base.OnModelCreating(modelBuilder);
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
//如果不加modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();这句话,在数据库表中表名会被设置为Movies。这种情况下,就需要移除这个契约。
}