public ProfileHelper(string id) { if (SecurityContext.IsAuthenticated) { id = String.IsNullOrEmpty(id) ? SecurityContext.CurrentAccount.ID.ToString() : id; ownInfo = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID); } if (!String.IsNullOrEmpty(id)) { UserInfo = CoreContext.UserManager.GetUserByUserName(id); } if (UserInfo == null || UserInfo.Equals(Constants.LostUser)) { if (!String.IsNullOrEmpty(id)) { try { userID = new Guid(id); } catch { userID = SecurityContext.CurrentAccount.ID; } } if (!CoreContext.UserManager.UserExists(userID)) { userID = SecurityContext.CurrentAccount.ID; } UserInfo = CoreContext.UserManager.GetUsers(userID); } else { userID = UserInfo.ID; } userProfile = new MyUserProfile(userID); }