Copied to clipboard

Flag this post as spam?

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


  • Jonathan Roberts 409 posts 1063 karma points
    Apr 24, 2015 @ 15:42
    Jonathan Roberts
    0

    Get Members using multiple roles

    Hi, Is it possible to get all members using multiple Roles. I have looked at the Memberservice GetMembersInRole but this only allows a single role to passed in. Is there a way to get all members who have multiple roles, for example:

    GetMembersInRole("Fulltime","Teacher","Football")

    If not that way would there be an alternative way?

    Many thanks

    Jon

  • Ryan 34 posts 138 karma points
    Apr 24, 2015 @ 17:10
    Ryan
    0

    Hi Jon,

    Off the top of my head you could do something like this.

    Inside a surface controller or helper class

     var listofRoles = new List<string>
     {
         "Role1",
         "Role2",
         "Role3"                   
     };
    
     foreach (var role in listofRoles)
     {
        var members =  MemberService.GetMembersInRole(role);
        //Do what you want me the member
     }
    

    Hope that helps!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies