Пример #1
0
        public async Task <UserIdentityResult> AddNewUserAsync(AddUserRequest addUser, string password)
        {
            try
            {
                var userId = await _userData.AddNewUserAsync(addUser, password);

                return(new UserIdentityResult
                {
                    Id = userId,
                    Succeeded = true,
                    Errors = null
                });
            }
            catch (Exception e)
            {
                return(new UserIdentityResult
                {
                    Id = 0,
                    Succeeded = false,
                    Errors = new[] { e.Message }
                });
            }
        }