FindByUserID() public static method

public static FindByUserID ( System.Guid UserID ) : ExtendedUserData
UserID System.Guid
return ExtendedUserData
Example #1
0
        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);
        }