Beispiel #1
0
        public async Task <AnswerModel> AddUser(UserViewModel user, string email)
        {
            var _user = new User
            {
                Email = email,
            };

            _user.AssignUser(user);
            var password = Passwords.New();
            // TODO: Send Email.
            var result = await _userManager.CreateAsync(_user, password);

            if (!result.Succeeded)
            {
            }
            var answer = await AddRolesToUser(_user, user.Roles);

            if (answer.ProblemDetails != null)
            {
                return(answer);
            }
            return(new AnswerModel(_user));
        }