Reputation: 15144
In my ConfigureServices
I have:
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<Context>(options => options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));
services.AddIdentity<User, IdentityRole>()
.AddEntityFrameworkStores<Context>()
.AddDefaultTokenProviders();
//...
}
And in Configure
I have:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
//...
app.UseIdentity();
//...
}
When I dnx . add migration addingIdentity
, I don't get any of the identity tables created in the new migrations file (so the apply
doesn't do anything).
What's missing?
Upvotes: 2
Views: 1398
Reputation: 15144
Turns out it was because my DbContext wasn't inheriting from IdentityDbContext...
public sealed class Context : IdentityDbContext<IdentityUser>
Upvotes: 1