Carrotware.CMS.Core.SecurityData.AttemptCreateApplicationUser C# (CSharp) Метод

AttemptCreateApplicationUser() приватный Метод

private AttemptCreateApplicationUser ( ApplicationUser user, string password, ExtendedUserData &newusr ) : Microsoft.AspNet.Identity.IdentityResult
user ApplicationUser
password string
newusr ExtendedUserData
Результат Microsoft.AspNet.Identity.IdentityResult
        private IdentityResult AttemptCreateApplicationUser(ApplicationUser user, string password, out ExtendedUserData newusr)
        {
            newusr = null;
            var result = new IdentityResult();

            lock (newUsrLock) {
                if (user != null && !String.IsNullOrEmpty(user.Id)) {
                    using (var securityHelper = new SecurityHelper()) {
                        result = securityHelper.UserManager.Create(user, password);

                        if (result.Succeeded) {
                            user = securityHelper.UserManager.FindByName(user.UserName);

                            newusr = new ExtendedUserData();
                            newusr.UserKey = user.Id;
                            newusr.Id = user.Id;
                            newusr.Save();

                            newusr = ExtendedUserData.FindByUserID(newusr.UserId);
                        }
                    }
                }
            }

            return result;
        }