views:

65

answers:

0

I has method which should return users with highest points.

Points are stored in aspnet_Profile table, so i can get these points in the way like this: ProfileBase.Create(mu.UserName).GetPropertyValue("Points").

So at first i call

IEnumerable<MembershipUser> users = Membership.GetAllUsers().Cast<MembershipUser>();

and then (i'm using linq to sql) trying to sort by points:

users = users.OrderByDescending(mu => ProfileBase.Create(mu.UserName).GetPropertyValue("Reputation"));

the problem is that this query exucuting ~12secs... how can i achieve this in other way?