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

  • Home
  • SEARCH
  • 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 6350199
In Process

The Archive Base Latest Questions

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

I could use some help with a RIA services query that I have been

  • 0

I could use some help with a RIA services query that I have been struggling with for a bit now…

Person has a collection of DailyScore.

I want to be able to produce a query that is filtered on both Person and DailyScore.

DateTime start = ...
DateTime end = ...

var personQuery = context.GetPersonQuery().Skip.(10).Take(10)
var scoresQuery = from s in ctx.GetDailyScoresForPeriod(start, end)
                      where personQuery.Contains(s.Person)
                      select s;

...load the scoresQuery

What I would ideally want is the Person objects loaded with the appropriate DailyScores for the specified period.n We can assume all the ‘includes’ are in place too.

Is this possible in RIA Services? If so, can somebody give me the correct way of going about it, and if not are there any work arounds?

I feel like this is a simple request, so hopefully this is easy.

Thanks is advance,
Shane.

Also, can someone point me to a good online resource about the rules around using EntityQueries on the client side with RIA Services? I have struggled to find anything like this.

  • 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-24T21:46:00+00:00Added an answer on May 24, 2026 at 9:46 pm

    Actually, the query you are trying to do is not supported. You can’t use Contains, Any, and similar constructs where you need to filter data in a collection.
    In these scenarios you have two options:

    • Perform both queries separately, and then filter the data on the client. This approach has performance issues, because you are retrieving all the data from the server, and then filtering it out. In your case, you would something like this:

      var personQuery = context.GetPersonQuery().Skip.(10).Take(10);
      var scoresQuery = context.GetDailyScoresForPeriodQuery(start, end);
      
      // Load both queries and then:
      scores.Where(s => persons.Contains(s.Person))
      
    • Perform the query in the server. This approach is more performant, but you need to define a way to filter the persons in the same query. In your case, if you only want the persons whose ids fall in a specific range for example, you should add this method to your domain context (in the server):

      IQueryable<DailyScore> GetDailyScoresForPeriodForPersons(DateTime start, DateTime end, int firstPerson, int lastPerson)
      {
          return context
              .DailyScores
              .Where(s => s.Start > start && s.End < end)
              .Where(s => s.Person.ID >= firstPerson && s.Person.ID < lastPerson)
      }
      

      Then in your client, you would call it like this:

      var scoresQuery = context.GetDailyScoresForPeriodForPersons(start, end, 10, 20)
      

    Some resources:

    • Domain Context and Operations

    • Walkthrough: Adding Query Methods

    • RIA Services and relational data

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a piece of code here that i really could use some help
I could use some help creating an XSL template that will take a string
We're having a small issue and could use some help - we have the
i have an issue i could use some help with, i have python list
Could use some help. I am utterly stuck, been trying to fix this one
I could use some help writing a SQL query. I'm trying to display some
I am new to rails so could use some help here. I have followed
Question I am running a bit of an experiment and could use some help.
I could use some help with a problem I've been having: I've started building
having a problem here so hopefully could use some help. I have a text

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.