I have been using EF Core Power Tools to reverse engineer an existing SQL database. We are now at the stage where we wanted to implement identity, I have setup the program.cs
with this code:
builder.Services
.AddIdentity<IdentityUser, IdentityRole>()
.AddEntityFrameworkStores<ProjectDbContext>()
.AddDefaultTokenProviders();
From what I read the ProjectDbContext
should inherit from IdentityDbContext
, not DbContext
. Currently using EF Core Power Tools, it generates the DbContext
as:
public partial class ProjectDbContext: DbContext
If I manually change that then the next time I build using Power Tools it will override it. Is there anyway to get that to work with IdentityDbContext
? I've tried to add another partial class into the project:
public partial class ProjectDbContext: IdentityDbContext
but that causes the error:
Partial declarations of 'ProjectDbContext' must not specify different base classes