Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
How to add role to user in default database created by mvc
Mikulas Luckanic
Nov 4 2015 1:48 PM
650
Reply
How can I convert this:
RoleManager<IdentityRole> roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(new IdentityDbContext()));
UserManager<ApplicationUser> userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
roleManager.Create(new IdentityRole(RoleName));
ApplicationUser user = userManager.FindByEmail(UserName);
userManager.AddToRole(user.Id, RoleName);
to two dropdown lists and one button?
I want add role to user in default database. Thx
asp.net
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
how to enter math. equation in text box
Display data in mvc