The entity type ApplicationUser is not part of the model for the current context. Used two different databases at beginning of project

后端 未结 2 612
无人及你
无人及你 2021-01-14 16:03

I\'ve created an MVC 4 application using entity framework to read and write data to a database I am hosting on an Azure database. The Azure database was supposed to keep th

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-14 16:49

    Use your database name instead of passing connection string. Check the database name in my example TestDB

    public class ApplicationDbContext : IdentityDbContext
        {
            public ApplicationDbContext()
                : base("TestDB", throwIfV1Schema: false)
            {
            }
    
            public static ApplicationDbContext Create()
            {
                return new ApplicationDbContext();
            }
        }
    

提交回复
热议问题