Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7593693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:13:59+00:00 2026-05-30T21:13:59+00:00

Hope somebody can help. Have looked around on the net but cannot seem to

  • 0

Hope somebody can help.

Have looked around on the net but cannot seem to solve (or understand) this.

I have tried the code posted at

http://blogs.msdn.com/b/kylemc/archive/2010/05/10/using-asp-net-membership-in-silverlight.aspx
(not going to repeat the class MembershipServiceUser here as it is quite long and can be seen on the mentioned page)

I have set up the domain service with the class and the code to return the users:

//[RequiresRole("Managers")]
public IEnumerable<MembershipServiceUser> GetAllUsers()
{
    return Membership.GetAllUsers().Cast<MembershipUser>().Select(u => new MembershipServiceUser(u));

}

I took out the RequiresRole for testing.

What I seem to be a bit blonde about is the calling of the GetAllUsers() method.

In my code behind I am using:

MembershipDataContext context = new MembershipDataContext();
EntityQuery<MembershipServiceUser> users = context.GetAllUsersQuery(); 

I am not 100% sure if this is the correct way to use the method or if something else is wrong because

context.GetAllUsersQuery(); returns "Enumeration yielded no results"

One question is also in the code kylmc uses //RequiresRole(“Admin”)]. Is this a custom role created in the ASP.NET Configuration editor?

Looking at another tutorial regarding using the ASP.NET authentication service in Silverlight, I create a role called “Managers” and added the login user to that role.
Logging in using a user with role Managers doesn’t help and results are still not yielded.

Any ideas I could possible look at?

Many thanks

Neill

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:14:00+00:00Added an answer on May 30, 2026 at 9:14 pm

    There are two steps involved with querying.

    1. Get a query object from the Domain Service context (synchronous).
    2. Load the query from the Domain Service context (asynchronous).

    Example:

    public void Load()
    {
      // define the query
      var query = context.GetAllUsersQuery();
    
      // start running the query, and when the results return call
      // OnGetAllUsersLoaded
      context.Load(query, OnGetAllUsersLoaded, null);
    }
    
    public void OnGetAllUsersLoaded(LoadOperation op)
    {
      var results = op.Entities;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small problem, but I hope somebody can help. Let's say that
This is a total dah question but I hope somebody can help me out.
i have a problem with jquery/visible. Hope somebody can help me. This code works,
I hope somebody can help work out to do this. Basically, I have a
I hope somebody can help me with this. I have a script that generates
I hope somebody can help me here, I have a table that has the
I hope somebody can help. I have been using JQuery Tools to validate my
I need some advice here, I hope somebody can help me. I have the
Hope somebody can help me. I am just learning C# and I have a
Hi i have stepped into some problem related to timer. hope somebody can help..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.