I'm having trouble finding information around searching for members on the front end. I'm trying to make a contact list, but I've got a few different member groups and I only want results from one group.
So far I've got:
var selection = ApplicationContext.Current.Services.MemberService.FindByUsername(searchName, 0, 10, out totalRecords,
global::Umbraco.Core.Persistence.Querying.StringPropertyMatchType.Contains).OrderBy(x => x.Name)
Which searches all the groups. I've tried
var selection = ApplicationContext.Current.Services.MemberService.FindByUsername(searchName, 0, 10, out totalRecords,
global::Umbraco.Core.Persistence.Querying.StringPropertyMatchType.Contains).OrderBy(x => x.Name).Where(x => x.GetValue("MemberGroup") == "GROUP");
but it says MemberGroup doesn't exist. Am I on the right lines? Is there a better way? All help appreciated.
Members search
Hi Everyone,
I'm having trouble finding information around searching for members on the front end. I'm trying to make a contact list, but I've got a few different member groups and I only want results from one group.
So far I've got:
Which searches all the groups. I've tried
but it says MemberGroup doesn't exist. Am I on the right lines? Is there a better way? All help appreciated.
Thanks
Seems I was going about this the wrong way. I've ended up using GetMembersByGroup and adding the where clause onto there i.e.
is working on a reply...