Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult CreateUser(string Email,string Password)
- {
- try
- {
- if (!(Email == null || Email == "" || Password == "" || Password == null))
- {
- IdentityUserModel UserModel = new IdentityUserModel();
- UserModel.Email = Email;
- UserModel.PasswordHash = Password;
- UserModel.UserName = Email;
- string userid=_authenticationService.CreateUser(UserModel);
- if (userid!=null)
- {
- //bool result=_authenticationService.AddToRoles(userid,[])
- **_authenticationService.CreateRole("مشتری");**
- }
- var MessageFile = messageclass.ShowMessage((int)MessageClass.MessageKind.objectsavefilerror);
- return Json(MessageFile, JsonRequestBehavior.AllowGet);
- }
- }
- public bool CreateRole(string rolename)
- {
- var result=_roleManager.Create(new IdentityRole(rolename));
- return result.Succeeded;
- }
Add Comment
Please, Sign In to add comment