예제 #1
0
        private async Task <bool> RegisterMethod(ApplicationUser user, string password, RoleEnum roleEnum)
        {
            var accountCreatedRes = await RegisterUser(user, password);

            if (!accountCreatedRes)
            {
                return(false);
            }
            await _signInManager.UserManager.AddToRoleAsync(user, roleEnum.ToStringName());

            if (!(await CheckUserExistAsync(user.Email)))
            {
                return(false);
            }
            return(true);
        }