I want integrate IdentityContext with mydbcontext but i am taking this error
One or more validation errors were detected during model generation:
Ivdb.Dal.Co
Your code does't show this, but from the errors you are getting I assume that you are overriding OnModelCreating.This is where IdentityDbContext configure the entity framework mappings. This means that if you want to override OnModelCreating you need to either call the base or you must do the mapping yourself.
So either this:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
// your stuff here
}
Or you do the mapping:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity().HasKey(l => l.UserId);
modelBuilder.Entity().HasKey(r => r.Id);
modelBuilder.Entity().HasKey(r => new { r.RoleId, r.UserId });
}