Identity 2.0 Code First Table Renaming

前端 未结 1 1068
我在风中等你
我在风中等你 2021-01-24 09:38

I\'m trying to rename the identity tables to Roles, Users, UserRoles, UserLogins and UserClaims. I partially succeeded doing and using the command Update-Table updates my databa

1条回答
  •  孤城傲影
    2021-01-24 10:02

    You must be inheriting from the IdentityUser class. (Do you have a custom user class that inherits from IdentityUser?). If that's the case, don't overwrite the table name for IdentityUser, but only for your custom user class. Assuming that your custom user class is ApplicationUser:

    modelBuilder.Entity().ToTable("Users");
    

    delete or comment the following line

    //modelBuilder.Entity().ToTable("Users", "dbo");
    

    0 讨论(0)
提交回复
热议问题