Home > Articles > Details

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?

 


Please Login to see the rest of the answer
Answer:
Look into your application and find ApplicationDbContext and add the code below.

  public class ApplicationDbContext : IdentityDbContext<InsertYourIdentityClassModal>
    {
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
            : base(options)
        {
        }
    }

If you log in, you will be notified when someone leaves a comment.

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


© 2022 - ErnesTech - Privacy