0
在现有的项目中,我怎么知道它是代码优先还是数据库优先呢?如何了解项目是代码优先还是数据库优先?
项目具有以下代码行:
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; }
}
编辑2017年5月12日
如果我改变从connection string
和运行项目database name
,它会创建database with the new name
with all tables
。可能是这会被打回答。
任何迁移类? – ErikEJ
@ErikEJ你是指player.cs类吗? –
不,我是指具有迁移代码的类(我认为从DbMigration继承而来) – ErikEJ