在Identity
2中,我看到它有几个参数
public ApplicationDbContext()
: base("DefaultConnection", throwIfV1Schema: false)
{
}
答案 0 :(得分:1)
在asp.net核心中,您必须覆盖OnConfiguring:
protected override void OnConfiguring ( DbContextOptionsBuilder optionsBuilder)
{
var connString = "";
optionsBuilder.UseSqlServer(connString);
base.OnConfiguring(optionsBuilder);
}