在现有项目中,我如何知道它是代码优先还是数据库优先?
项目有这行代码:
public class TestDBContext : DbContext
{
public DbSet<Player> Players { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
}
}
并且项目没有.edmx
文件。如果需要任何其他细节,我会分享。
编辑:
Player.cs 类
public class Player
{
public int PlayerID { get; set; }
public string PlayerName { get; set; }
}
编辑 12.05.2017
如果我更改database name
并connection string
运行项目,它会创建database with the new name
with all tables
. 可能这会被击中的答案。