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)
        {
        }
    }





© 2024 - ErnesTech - Privacy
E-Commerce Return Policy