sorting order on request

Nov 10, 2014 at 6:29 PM
Hi, congratulations the manipulation tool for ldap.

I am recently with the need to bring the users already order alphabetic by DisplayName property.

For example, my domain, contains about 700 000 users, and request all users is a very time consume process.

I found a solution to this problem was to use linqtoldap to do pagination, and I am returning only the number of users that I need per page. But the order alphabetic will take only course in the collection that I return per page.

Is there any way to return the data already sorted?

Before using linqtoldap, was using DirectorySearcher. This class contains a parameter called Sort, which is set a value of type sortOption.

With this sort, I managed to return the sorted data, but with the amount of users take long to return

Can help me?

Thanks!

:)
Coordinator
Nov 12, 2014 at 12:02 AM
Yes, you can use OrderBy and OrderByDescending (adds a SortRequestControl behind the scenes) to generate a server side sort, but be aware that server side sorts are inefficient in LDAP. See this blog post. You may also look into indexing the properties you are filtering and sorting by to improve performance.