I am making a simple birthday calendar webpart for Sharepoing 2010.
I need to iterate through all users of a site and show those who have birthday on said date. I need to present users in alphabetical order of their names.
I can iterate through user list by doing ilke this:
SPSite currentSite = ...
ServerContext ospServerContext = ServerContext.GetContext(currentSite);
UserProfileManager ospUserProfileManager = new UserProfileManager(ospServerContext);
foreach (UserProfile ospUserProfile in ospUserProfileManager) { ... }
However, then i have no control over the order of profiles. Is there any built in way to order the profiles by some simple rule, or do i have to make a Dictionary(string,UserProfile), fill it from UserProfileManager, then sort it by its key, and then do foreach for its members?
Thanks!