Copied to clipboard

Flag this post as spam?

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


  • José Lopes 10 posts 30 karma points
    Aug 24, 2015 @ 15:50
    José Lopes
    0

    MemberService very slow

    Hi,

    I'm tying to list all the members by type and do a pagination, but as soon as I call method GetMembersByMemberType it just wont move. It takes around 1 to 2 minutes to list and I only have little over 4000 members. Can anyone tell me what I'm doing wrong please.

    var ms = ApplicationContext.Services.MemberService;
    IEnumerable<IMember> list = null;
    list = ms.GetMembersByMemberType("Candidato").Where(x => x.IsApproved == true).OrderByDescending(x => x.Id);
    

    Our is there any alternative?

    Thanks

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Sep 01, 2015 @ 12:21
    Alex Skrypnyk
    0

    Hi Jose,

    Yes, MemberService is slow, why do you need so complicated request? Can you do some another logic ? Maybe more checks in the query.

    Thanks, Alex

  • José Lopes 10 posts 30 karma points
    Sep 01, 2015 @ 12:28
    José Lopes
    0

    I've edited the post so it would be more simple.

    I need to get all member that are active and are from the type "Candidatos", is there any other way to do this without the MemberService?

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Sep 01, 2015 @ 13:04
    Alex Skrypnyk
    0

    Jose, I'm afraid that you can do nothing. Maybe add some indexes to Umbraco database, but get all members by user group is heavy request.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft