在 ASP.NET Core 1.1 中,我使用 ApplicationDbContext 作为用户身份上下文和我的模型数据,遵循this。
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
}
并在启动-> 配置中:
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
现在我正在尝试asp.net core 2 preview。
但是现在我们有了 IdentityServiceDbContext:
public class IdentityServiceDbContext : IdentityServiceDbContext<ApplicationUser, IdentityServiceApplication>
{
public IdentityServiceDbContext(DbContextOptions<IdentityServiceDbContext> options)
: base(options)
{
}
}
问题是:我可以为我的数据使用 IdentityServiceDbContext 还是应该创建单独的 dbcontext?
看起来他们将 IdentityServiceDbContext 移至身份服务。