I'm trying to build an ASP .Net Core application and I'm exploring using Entity Framework Core through Code First.
I've previously always used a separate DbContext for Identity to the application bits, however, I want to neaten the code in this application.
I've tried looking in to Identity Framework's IdentityDbContext the best I can but, I'm no expert at decompiling (looking through Dotpeek).
Whilst I see some references to DbContextOptions
, I can't see it actually directly inheriting DbContext anywhere.
So, my questions are:
Do I need to and do I lose anything just by using the default generated code of:
public class ApplicationDbContext : IdentityDbContext
or should I be also inheriting DbContext?
When trying to call the context directly, I don't seem to have some of the user methods I've been reading in examples (such as this link). I have seen example code similar to:
public class ApplicationDbContext : IdentityDbContext<User, UserClaim, UserSecret, UserLogin, Role, UserRole, Token, UserManagement>
Is this safe and/or are there any downsides?