I've been following this Microsoft Article on implementing a secure web app. It is working fine with the local database. But when I change the connection string to the external database I consistently get an error when trying to interact with the identity tables
- AspNetUsers
- AspNetRoles
- AspNetUserClaims
- AspNetUserLogins
- AspNetUserRoles
These tables have been re-created in the external Azure db and I followed this walkthrough. The error I get when trying to register is
The entity type ApplicationUser is not part of the model for the current context.
When trying to register it fails on this line of code in the AccountController
var user = await UserManager.FindByNameAsync(model.Email);
I want to take a database first approach as the external db already has pre-existing data. I've looked at several other posts and sites but I've been unable to solve the issue. I've also tried enabling and updating the db with no success through the Package Manager Console.
Thank you in advance!
Here is the ApplicationDbContext
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("DefaultConnection", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
//ApplicationDbContext.Equals("", "");
return new ApplicationDbContext();
}
public System.Data.Entity.DbSet<proj.Models.Obj1> Obj3 { get; set; }
public System.Data.Entity.DbSet<proj.Models.Obj2> Obj3 { get; set; }
public System.Data.Entity.DbSet<proj.Models.Obj3> Obj3 { get; set; }
}