Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

New Post: Implement ASP.Net Identity 2.0 with IdentityDbcontext

$
0
0
Hi everyone, I have a question, I don't know how to at least Add a User to a Role with this framework its very nice and Ive been working with a lot, but sometimes its too rigid, for example Ive been trying to do this
IdentityResult result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
    await UserManager.AddToRoleAsync(user.Id, @"JobProvider");
}
There is an exeption because it says that "Unable to cast IdentityUserRole to IObjectState" like I said I don't know how to figure it out please if you have a solution for my issue I'll appreciate you all,

Thanks

Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>