Copied to clipboard

Flag this post as spam?

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


  • John Walker 41 posts 136 karma points
    May 31, 2015 @ 17:45
    John Walker
    0

    Extending Member Service to find Members by Created Date

    Hello,

    I'm looking for a way to get a list of members who have been created after a certain period of time. Sadly I cant use the GetAll method and then filter as the db has well over 30,000 members, other options included using the GetMembersByPropertyValue but the created date is not a property value I believe I can filter on. 

    Does anyone know a way that I can extend upon the methods available in the MemberService to build this query https://github.com/umbraco/Umbraco-CMS/blob/b35397b4642f6a715335fad508c7072fdd37dc5e/src/Umbraco.Core/Services/MemberService.cs

    Any help would be much appreciated

    John

  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    May 31, 2015 @ 18:33
    Andy Butland
    100

    Wondering if you might be better doing a database query for this on the cmsMember table, join on umbracoNode and you can query by the createDate field, then if you do need full members get the Ids from the database and pass to GetllMembers().

  • John Walker 41 posts 136 karma points
    May 31, 2015 @ 18:40
    John Walker
    0

    Ah OK, cheers Andy will give that a go using the db context then pass that array of members ids to the GetAllMembers.

  • John Walker 41 posts 136 karma points
    May 31, 2015 @ 22:30
    John Walker
    0

    That did the job thanks Andy

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jun 01, 2015 @ 11:39
    Ismail Mayat
    0

    Guys,

    Examine cough cough

    Regards

    Ismail

  • John Walker 41 posts 136 karma points
    Jun 01, 2015 @ 11:40
  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jun 01, 2015 @ 11:55
    Ismail Mayat
    0

    Doh did not know that. I guess you could create your own indexer and use the sql query idea andy posted and index that way, more work but it will be lightening quick but if sql is speed wise adequate then stick with what works.

    Regards

    Ismail

  • John Walker 41 posts 136 karma points
    Jun 01, 2015 @ 12:14
    John Walker
    0

    No speed wise it's fine for a one off process, thanks though mate.

  • Dan 61 posts 185 karma points
    Jun 24, 2015 @ 15:36
    Dan
    0

    Im on a problem as this can I aske how you did this ? :D

Please Sign in or register to post replies

Write your reply to:

Draft