public IdentityResult CreateUserAccount(CreateAccountDto createAccountDto) { var userAccount = Mapper.Map <UserAccount>(createAccountDto); IdentityResult CreateIdentityReuslt = _userManager.CreateUserAccount(userAccount, createAccountDto.Password); if (CreateIdentityReuslt.Succeeded) { _userManager.AddUserToRole(createAccountDto.UserName, createAccountDto.RoleName); } return(CreateIdentityReuslt); }