Sholo.Web.Security/Authentication/User/Provider/CacheUserAuthenticationTicketProvider.cs
/// <summary>
/// Retrieves all non-expired UserAuthenticationTicket keys in the ticket store associated 
/// with the username supplied.
/// </summary>
/// <param name="username">The username to search the collection for</param>
/// <returns>An enumerable collection of tickets</returns>
/// <exception cref="ArgumentNullException">username is null</exception>
/// <exception cref="ArgumentException">username is empty</exception>
Retrieves all non-expired UserAuthenticationTicket keys in the ticket store associated
with the username supplied.
Retrieves all non - expired UserAuthenticationTicket keys in the ticket store associated with the username supplied .
public override IEnumerable<string> GetUserTicketKeys(string username)
        {
            if (username == null)
            {
                throw new ArgumentNullException("username", "username parameter cannot be null or empty.");
            }
            if (string.IsNullOrEmpty(username))
            {
                throw new ArgumentException("username parameter cannot be null or empty.", "username");
            }
            IDictionaryEnumerator enumerator = HttpContext.Current.Cache.GetEnumerator();
            while (enumerator.MoveNext())
            {
                string currentKey = enumerator.Entry.Key as string;
                if (currentKey != null && currentKey.StartsWith(UserTicketKeyPrefix))
                {
                    UserAuthenticationTicket currentAuthTicket = enumerator.Entry.Value as UserAuthenticationTicket;
                    if (currentAuthTicket != null && string.Compare(currentAuthTicket.Username, username, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        yield return currentAuthTicket.Key;
                    }
                }
            }
        }
public override IEnumerable < string > GetUserTicketKeys ( string username ) { if ( username == null ) { throw new ArgumentNullException ( " " , " " ) ; } if ( string . IsNullOrEmpty ( username ) ) { throw new ArgumentException ( " " , " " ) ; } IDictionaryEnumerator enumerator = HttpContext . Current . Cache . GetEnumerator ( ) ; while ( enumerator . MoveNext ( ) ) { string currentKey = enumerator . Entry . Key as string ; if ( currentKey != null && currentKey . StartsWith ( UserTicketKeyPrefix ) ) { UserAuthenticationTicket currentAuthTicket = enumerator . Entry . Value as UserAuthenticationTicket ; if ( currentAuthTicket != null && string . Compare ( currentAuthTicket . Username , username , StringComparison . OrdinalIgnoreCase ) == 0 ) { yield return currentAuthTicket . Key ; } } } }
Retrieves all non-expired UserAuthenticationTicket keys in the ticket store associated
with the username supplied.
Retrieves all non - expired UserAuthenticationTicket keys in the ticket store associated with the username supplied .
An enumerable collection of tickets
An enumerable collection of tickets
username is null
username is null
username is empty
username is empty
username
string
The username to search the collection for
The username to search the collection for