I am trying to learn how the new asp.net identity 2.0 works, but with little documentation I am hitting quite a few stumbling blocks.
I have this code below based of
This worked me. Seems you have to create own usermanager and userstore if you create custom users and roles. This is the derived UM(you can create the same way the rolemanager too):
public class ApplicationUserManager : UserManager
{
public ApplicationUserManager(IUserStore store)
: base(store)
{
}
}
public class ApplicationUserStore : UserStore
{
public ApplicationUserStore(ApplicationDbContext context)
: base(context)
{
}
}
Then create the UserManager:
ApplicationUserManager um = new ApplicationUserManager(new ApplicationUserStore(new ApplicationDbContext()));