Migrating to Asp.Net Identity 2.0: new columns not being created in AspNetUsers table

前端 未结 7 1488
感情败类
感情败类 2020-12-29 13:28

I get the following error when I try to register a new user, using Identity 2.0 and the default MVC 5 application:

Invalid column name \'Email\'.
Invalid col         


        
7条回答
  •  鱼传尺愫
    2020-12-29 13:57

    Are you sure you got the correct User class in your Dbcontext? If you want to modify your User table you should inhert like this:

    public class ApplicationDbContext : IdentityDbContext
    {
        ...
    }
    

    and don t put anything like:

    public DbSet Users { get; set; }
    

    in there since it will already happen in the base class.

提交回复
热议问题