Comments on: Using LINQ with the MOSS UserProfileManager Because I like to share knowledge Mon, 29 Jun 2009 08:01:40 +0000 hourly 1 By: Filipe Cavalcante Mon, 29 Jun 2009 08:01:40 +0000 Hello there!
That is a nice post!
But I have a question. I need to do a search into my UserProfiles to find whom i want, but this in my SSP i have more than 9thousand users sincronized with AD.
how could i make this search into these all users from SSP without crash my connection. lol
see my code (very simple):
UserProfileManager allUsers = new UserProfileManager(context);
List fullSet = new List();
foreach (UserProfile user in allUsers)
return from user in fullSet
where (user["FirstName"].Value != null) ? user["FirstName"].Value.ToString().ToLower().Contains(Nome.ToLower()) : user["AccountName"].Value.ToString().ToLower().Contains(Nome.ToLower())
select user;
Thx anyway!
(sorry about my english... just learning yet! =D)