I had Data access implemented as below and was working
- Contexct inheriting from DB Context
- Had OnModelCreating for configurations
- Manually addding configurations
However I modified my context to inherit
from IdentityDbContext<ApplicationUser>
and stopped manually generating configurations and after that the OnModelCreating fails and DB updates not happening at all.
If I remove the OnModelCreating
, it works fine. As soon as I run the application.
Can any one guide me whats going wrong here?
I was missing the below line in the OnModelCreating method override. After that it started working.
base.OnModelCreating(modelBuilder);