Пример #1
0
        public static User CreateUser(string name, string userName)
        {
            Guard.Against.NullOrEmpty(name, nameof(name));
            Guard.Against.NullOrEmpty(userName, nameof(userName));

            if (UsersList.Any(c => c.UserName.ToLower() == userName.ToLower()))
            {
                return(UsersList.Single(c => c.UserName.ToLower() == userName.ToLower()));
            }

            return(new User(name, userName));
        }