/// <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();
        }
        /// <summary>
        /// Verifies that the specified user id exists in the data source and is approved.
        /// </summary>
        /// <returns>
        /// true if the specified username exists and is approved; otherwise, false.
        /// </returns>
        /// <param name="username">The id of the user.</param>
        /// <param name="password">NOT SUPPORTED.</param>
        public override bool ValidateUser(string username, string password)
        {
            username.ThrowOnNullOrWhitespace("username");

            var user = LiveIdUser.GetByUserId(username, ConnectionStringName);

            if (user == null || !user.Approved)
            {
                return(false);
            }

            user.LastLogin = DateTime.UtcNow;

            user.Save();

            return(true);
        }
        /// <summary>
        /// Gets information from the data source for a user. Provides an option to update the last-activity date/time stamp for the user.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.Web.Security.MembershipUser" /> object populated with the specified user's information from the data source.
        /// </returns>
        /// <param name="username">The name of the user to get information for. </param>
        /// <param name="userIsOnline">true to update the last-activity date/time stamp for the user; false to return user information without updating the last-activity date/time stamp for the user. </param>
        public override MembershipUser GetUser(string username, bool userIsOnline)
        {
            if (string.IsNullOrEmpty(username))
            {
                return(null);
            }

            var user = LiveIdUser.GetByUserId(username, ConnectionStringName);

            if (user == null)
            {
                return(null);
            }

            if (userIsOnline)
            {
                user.LastLogin = DateTime.UtcNow;
                user.Save();
            }

            return(new MembershipUser(Name, user.UserId, user.UserId, string.Empty, string.Empty, string.Empty, user.Approved, false, user.CreatedAt.Value, user.LastLogin, user.LastLogin, DateTime.MinValue, DateTime.MinValue));
        }
        /// <summary>
        /// Removes a user from the membership data source.
        /// </summary>
        /// <returns>
        /// true if the user was successfully deleted; otherwise, false.
        /// </returns>
        /// <param name="username">The name of the user to delete.</param>
        /// <param name="deleteAllRelatedData">true to delete data related to the user from the database; false to leave data related to the user in the database.</param>
        public override bool DeleteUser(string username, bool deleteAllRelatedData)
        {
            LiveIdUser.Delete(username, ConnectionStringName);

            return(LiveIdUser.GetByUserId(username, ConnectionStringName) == null);
        }