Asp.Net Core 3.1 Identity Error:InvalidOperationException: Cannot create a DbSet for 'ClassModal' because this type is not included in the model for the context



Question: How do you resolve Error:InvalidOperationException: Cannot create a DbSet for 'ClassModal' because this type is not included in the model for the context?

 

Solution: Look into your application and find ApplicationDbContext and add the code below.

  public class ApplicationDbContext : IdentityDbContext<InsertYourIdentityClassModal>
    {
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
            : base(options)
        {
        }
    }
Asp.net Identity Error Technology published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue


© 2021 - ErnesTech - Privacy