Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Luke 110 posts 256 karma points
    Feb 14, 2015 @ 11:17
    Luke
    0

    Querying Members With Multiple Properties

    Good Morning,

    My members have about 100+ custom attributes. I wish to query the members by multiple properties and wish to know the most efficient (quickest) way of doing it.

    Either by an Api call like:

    MemberService.GetMembersByPropertyValue(MemberStatusAlias, StatusVal, StringPropertyMatchType.Exact).Concat(
    MemberService.GetMembersByPropertyValue(AnotherAlias, AnotherVal, StringPropertyMatchType.Exact));
    

    or maybe a stored procedure?

    Any advice would be greatly appreciated.

    Regards, L

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Feb 14, 2015 @ 14:03
    Alex Skrypnyk
    0

    Hi L,

    Of cource stored procedure will be faster, how many members do you have ? If it's not thousands you can use Umbraco api courageously.

     

    Thanks

  • Luke 110 posts 256 karma points
    Feb 16, 2015 @ 09:40
    Luke
    0

    Thanks for the kind reply!

    Currently there are hundreds but soon to be thousands. It would be nice in the future for an Umbraco method in which you can query by multiple values instead of just one.

    Or is there one and I am missing it??

    Also be good to see a StringPropertyMatchType that is not equal to !=

    Regards, L

  • Scott Devine 8 posts 73 karma points
    Jun 13, 2015 @ 00:28
    Scott Devine
    0

    Hi Luke did you get this working?

    I used the following to filter on next property required

    var Inspectors = ApplicationContext.Current.Services.MemberService.GetMembersByPropertyValue("Inspections", true);

    @foreach (var member in Inspectors) { if(Convert.ToBoolean(member.GetValue("umbracoMemberApproved"))){

    } }

  • Yakov Lebski 591 posts 2346 karma points
    Jun 13, 2015 @ 12:39
    Yakov Lebski
    0

    You can use uQuery.GetMembersByXPath also

Please Sign in or register to post replies

Write your reply to:

Draft