public static ADFSUser SearchExact(string pattern, ADFSUsers users)
        {
            ADFSUser[] allUsers     = users.Items;
            ADFSUser   filteredUser = (from u in allUsers
                                       where u.SearchableTerms.Contains(pattern)
                                       select u).FirstOrDefault();

            return(filteredUser);
        }
        public static List <ADFSUser> SearchUsers(string pattern, ADFSUsers users)
        {
            ADFSUser[]      allUsers      = users.Items;
            List <ADFSUser> filteredUsers = (from u in allUsers
                                             where u.SearchableTerms.Contains(pattern)
                                             select u).ToList();

            return(filteredUsers);
        }
        private static ADFSUsers GetAllUsers()
        {
            ADFSUsers           allUsers             = DeSerialize <ADFSUsers>(ADFSXMLFilePath);
            List <PropertyInfo> properties           = new List <PropertyInfo>();
            List <string>       searchableProperties = SearchableProperties;

            foreach (var prop in searchableProperties)
            {
                properties.Add(typeof(ADFSUser).GetProperty(prop));
            }

            foreach (var user in allUsers.Items)
            {
                StringBuilder sbSearchableString = new StringBuilder();
                foreach (PropertyInfo pi in properties)
                {
                    sbSearchableString.Append(Convert.ToString(pi.GetValue(user, null)).ToLower())
                    .Append(Constants.WHITE_SPACE);
                }
                user.SearchableTerms = sbSearchableString.ToString();
            }
            return(allUsers);
        }