Why does my asp.net mvc tables have pk duplicate user?

0

I'm using asp.net identity for authentication and authorization

I have my user class:

public class Usuario : IdentityUser<int, ApplicationUserLogin,ApplicationUserRole, ApplicationUserClaim>
{

}
public class ApplicationUserLogin : IdentityUserLogin<int> { }
public class ApplicationUserClaim : IdentityUserClaim<int> { }
public class ApplicationUserRole : IdentityUserRole<int> { }

I did this to be able to use the fk as Integer in asp.net mvc and not Guid as is the default.

My Role class

public class Role : IdentityRole<int, ApplicationUserRole>,IRole<int>
{

}

But in my Database table, it is generated:

UserId, RoleId, Usuario_Id

Why does this happen? What's wrong?

This is giving me a problem, because when I move to add a role to the user:

await _userManager.AddToRolesAsync(1, "Admin");

It fills in the UserId column but the Id_Id does not, so if I fill in manually it works out my authorization, otherwise it will not.

    
asked by anonymous 23.09.2014 / 23:46

0 answers