views:

273

answers:

1

I am using the SqlProfileProvider class in one of my projects and I would like to be able to search for profiles on an arbitrary profile property (e.g. Birthday).

The only search method that I have seen is the ProfileManager.FindByUserName.

Has anyone implemented that? Or do I have to iterate over the list of profiles (very inefficient) and filter?

A: 

If you're going to only use the provider mechanisms, your only option is to iterate over the profiles.

However, you can certainly role your own method to search on other properties. Instead of calling ProfileManager.FindByBirthday, you'll just call your method directly off of your custom class.

Larsenal
The problem with that is to load all profiles in memory. My concern is with performance. My workaround was to load the minimum set of properties in cache and use linq to find the data.
pablo
I should have stated this, but my idea was to directly run your query against the DB. That will give you good performance.
Larsenal