I changed the primary key for the user database from string to int using the tutorial here, but I\'m having difficulty initializing the Role Manager. It used to be initiali
Hope this helps.
var roleManager = new RoleManager(new RoleStore(context));
var UserManager = new UserManager(new UserStore(context));
// In Startup iam creating first Admin Role and creating a default Admin User
if (!roleManager.RoleExists("Admin")){
//first we create Admin rool
var role = new CustomRole();
role.Name = "Admin";
roleManager.Create(role);
}
////Here we create a Admin super user who will maintain the website
if (UserManager.FindByName("Admin") == null){
var user = new ApplicationUser() { UserName = "Admin" };
string userPWD = "adminadmin";
var chkUser = UserManager.Create(user, userPWD);
if (chkUser.Succeeded){
var result1 = UserManager.AddToRole(user.Id, "Admin")
;
}
}