Identity change GUID to int

后端 未结 3 778
天涯浪人
天涯浪人 2020-12-03 04:02

How does one change the PK column of the AspNetUser table from a guid to int data type? This should now be possible with the latest

3条回答
  •  一向
    一向 (楼主)
    2020-12-03 04:25

    if anyone finds this while looking for identity 3.0 guide:

    public class ApplicationUser : IdentityUser
    {
    }
    
    public class ApplicationRole : IdentityRole
    {
    }
    
    public class ApplicationDbContext: 
        IdentityDbContext
    {
    }
    

    in Startup.cs file, ConfigureServices method:

    services.AddIdentity()
        .AddEntityFrameworkStores()//, int being the only difference
        .AddDefaultTokenProviders();
    

    and that's all to it, no need to create your managers like in 2.0

    found this in this blog post.

提交回复
热议问题