/// <summary> /// Returns the membership user's remaining locked out time. /// </summary> /// <param name="membershipUser">The membership user that this extension method affects.</param> /// <exception cref="ArgumentNullException"><paramref name="membershipUser"/> is <c>null</c>.</exception> public static TimeSpan RemainingLockedOutTime(this MembershipUser membershipUser) { if (membershipUser == null) { throw new ArgumentNullException("membershipUser"); } return(membershipUser.IsLockedOut ? membershipUser.UnlockDate() - DateTime.Now : TimeSpan.Zero); }