I am using Umbraco 7 (C#).
Is there an easy way/method to search for all members with a custom property?
I know that there is an easy way to search for all members by the username by using the method
GetByUsername(string username) : returns IMember
And also for searcing by Email:
GetByEmail(string email) : returns IMember
Do you know of such a way to search by a property?
I have tried using the method ".Where" like so:
GetService().GetAllMembers().Cast<IMember>().Where("permalink=SOMESTRING").ToArray();
Unfortunatly there is an error, since i can't use the .Where() method here.
Any suggestions?
Thanks
You could just use the build in function in MemberService.
From the doc:
Services.MemberService
.GetMembersByPropertyValue("city", "Horsens");
//Returns all Members, of any type, with a mathcing value in the property with the given property alias
http://our.umbraco.org/documentation/Reference/Management-v6/Services/MemberService
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With