Example #1
0
        /// <summary>
        /// Determines if a contact has successfully saved their profile.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        public static bool ValidateProfileSuccessfullySaved(this OrganizationServiceContext context, MembershipUser user)
        {
            user.ThrowOnNull("user");

            if (user.ProviderUserKey is Guid)
            {
                return(ValidateProfileSuccessfullySaved(context, (Guid)user.ProviderUserKey));
            }

            return(false);
        }
        /// <summary>
        /// Updates information about a user in the data source.
        /// </summary>
        /// <param name="user">A <see cref="T:System.Web.Security.MembershipUser" /> object that represents the user to update and the updated information for the user. </param>
        public override void UpdateUser(MembershipUser user)
        {
            user.ThrowOnNull("user");

            var liveIdUser = LiveIdUser.GetByUserId(user.UserName, ConnectionStringName);

            if (liveIdUser == null)
            {
                throw new ArgumentException("Unable to find the user with ID '{0}'.".FormatWith(user.UserName));
            }

            liveIdUser.LastLogin = user.LastLoginDate;
            liveIdUser.Approved  = user.IsApproved;

            liveIdUser.Save();
        }