user is not in role error in AspNetCore Identity RRS feed

  • Question

  • Hi 

    Here by Added the code and image of my question 

    List<ApplicationUser> corpusers = new List<ApplicationUser>();
                corpusers.Add(new ApplicationUser

                    UserName = "",
                    Email = "",


    ApplicationRole tes = await roleManager.FindByNameAsync("candidate");

    var res2 = await userManager.RemoveFromRoleAsync(corpusers [0], "candidate");
    var result = await userManager.DeleteAsync(corpusers [0]);

    In res2 i am planning to remove a user role , user is mapped with role AspNetUserRole table and role is in AspNetRoles,

    but while trying remove it says User not in role 

    Friday, August 18, 2017 6:01 AM


All replies