Hello everybody,
I created the tables through Migration to manage the security of my mvc core project.
I would need to be able toinsert an additional field in the AspNetUserRoles table in order to manage the users already associated with the ADMIN role in a different way, for example I have ADMINs associated with a USA nation and ADMINs associated with another BRAZIL
or ADMIN nationassociated with ITALY, but their real role always remains ADMIN.
In practice it is just one more attribute to add when I associate a user with the ADMIN role.
I tried to extend the IdentityUserRole class in this way:
public class AspNetUserRoles : IdentityUserRole<string> { public string Nation { get; set; } }
but then when I launch the migration script (code-first) in the migration classes no changes are detected!
PM> Add-Migration aspnetuserrolesupdate -Context ApplicationDbContext
this is the result:
public partial class aspnetuserrolesupdate : Migration { protected override void Up(MigrationBuilder migrationBuilder) { } protected override void Down(MigrationBuilder migrationBuilder) { } }
as you can see from the product code no changes were found ....
In my project I have already inserted fields in the AspNetUsers andAspNetRoles table successfully in this way, but how can I add a third field to theAspNetUserRoles table ???
Thank you all