What version of umbraco are you using? If its later version then you can index the members into lucene index via examine then search that way. It will be lightening quick and much more efficient that getting all members then checking the expiry date field.
Best way to list members with a particular property value?
I need to write a little .Net code that will return a list of members based on a member property value.
I've added a new 'Date Picker' property to a member type called 'Expiry Date' and all the members will have this property set.
What is the best way to get a list of all the members where the value of this property is in the past using the API?
Regards,
Matt
Is there are way to get them in one hit rather than getting all members and then checking the property value of each?
Matt,
What version of umbraco are you using? If its later version then you can index the members into lucene index via examine then search that way. It will be lightening quick and much more efficient that getting all members then checking the expiry date field.
Regards
Ismail
Hi Ismail,
That's a good idea.
I was thinking there would be a linq query I could use on umbraco.cms.businesslogic.member.Member.GetAllAsList().
Seeing as there is already a member index set up I could use that.
In case anyone does want to use the linq method then this sort of thing will do the trick.
But not as efficiently as using lucene.
Regards,
Matt
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.