I am using the default ASP identity modelin my MVC application.
as per this post, I want to get a list of users which are in a role:
var users = Roles.GetUsersInRole("employee");
However, this always throws
The role 'employee' was not found.
Even though that role definitely does exist.
I can confirm this, as I am able to call :
User.IsInRole("employee")
For the current user, and this returns true.
I also noticed that these methods always return empty arrays:
var r = Roles.GetAllRoles();
var au = Membership.GetAllUsers();
Why is this?
I know I can get the roles by directly making calls to the database context, but why can't I use the built in methods?