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 3354606
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:17:36+00:00 2026-05-18T02:17:36+00:00

Ok, I’ve spent two days on this and am losing confidence in both myself

  • 0

Ok, I’ve spent two days on this and am losing confidence in both myself and the Entity Framework. I posted a question similar to this yesterday, but since I did not phrase it right, I was unable to get my issue resolved completely. Here it goes again.

First of all, I am writing a Silverlight application using RIA Services with the Entity Framework. In my database I have two very simple tables: HeaderTable and DetailsTable. The relationship between the two is a 1 to many. The EDM generated properties to navigate back and forth between these two entities. For example, in HeaderTable, I have a property called DetailTables that is a collection of all the DetailTalbe entities for the current HeaderTable entity.

Keeping it simple, from the client I want to return ALL of the HeaderTable entities. I do it like this:

public void TestFromClient()
{
  if (context == null)
  {        
    context = new TestContext();
    EntityQuery<HeaderTable> query = context.GetHeaderTablesQuery();
    context.Load<HeaderTable>(query);
  }

Within my callback method I do in fact get a collection to all the HeaderTable items. However, the property (DetialTables) which should hold all of my detail records is empty. Since these entities are related, I figured I would get them during the query. So, once I found I was not getting these entities, I made changes to my GetHeaderTables() on the server as follows:

public IQueryable<HeaderTable> GetHeaderTables()
{
  //return this.ObjectContext.HeaderTable;  // Original
  return this.ObjectContext.HeaderTable.Include("DetailTables");
}

This should now be explicitly bringing back my details within my headers, but just like my first attempt, by the time it gets to the client, the DetailTalbles property within my HeaderTable property is empty.
Just as a test, I decided to see what was going on within the server function GetHeaderTables() and did this so I could debug the value:

public IQueryable<HeaderTable> GetHeaderTables()
{
  //return this.ObjectContext.HeaderTable;  // Original
  //return this.ObjectContext.HeaderTable.Include("DetailTables");
  List<HeaderTable> test = this.ObjectContext.HeaderTable.Include("DetailTables").ToList();
}

Sure enough, all of my HeaderTable entities had a valid DetailTables property with a collection of all the details. So, it is working on the server, but it is not working on the client. I am clearly missing something, but I can’t figure out what. If anyone can see what I am doing wrong or have advice for going at this a different way, I’m all ears.

As a side note, I also can’t figure out why I am not able to specify the Include() on the client side context. Why only the server? Man, I’m lost!

-Scott

  • 1 1 Answer
  • 1 View
  • 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-18T02:17:37+00:00Added an answer on May 18, 2026 at 2:17 am

    You need to have the [Include] attribute on your entity on the server side context.

    [Include]
    public EntitySet<DetailTable> DetailTables { get; set; }
    

    This should be included in your metadata files for the model on the server.

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

Sidebar

Related Questions

This may be basic, but I've spent two days, read countless tutorials and I
I am still new to the storyboard stuff. I spent two days debugging this
I've spent two days on this and I still can't find the cause of
I've spent two days on this and have gotten nowhere. I'm trying to use
I've spent two days on this so far and combed through every source at
I've just spent two days on this. This is run in the game engine
Please help as I have spent two days on this... I have a JSON
So, I literally spent two days trying to get this into my head. I
I have spent the last two days reading up on this and ultimately have
I've spent the last two days trying to find a solution to this problem

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.