Пример #1
0
 private void CheckUsername(string username)
 {
     if (Identities.Any(x => String.Equals(x.Username, username, StringComparison.InvariantCultureIgnoreCase)))
     {
         throw new DuplicateUsernameException("The username '" + username + "' is already in use.");
     }
 }
Пример #2
0
        /// <summary>
        /// Returns true if an Identity exists with the username.
        /// </summary>
        public bool UsernameIsTaken(string username)
        {
            var value = username.ToUpperInvariant();

            return(Identities.Any(x => x.Username == value));
        }