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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:52:30+00:00 2026-06-02T06:52:30+00:00

Using WCF Data Services 4.0, I cannot get the hierarchical data to return. I

  • 0

Using WCF Data Services 4.0, I cannot get the hierarchical data to return. I have a class Employee that has a collection of EquipmentIds. Those EquipmentIds are getting lost over the wire. Here’s my code:

public class ODataV2 : DataService<ODataV2Model>
{
    public static void InitializeService(DataServiceConfiguration config)
    {
        config.UseVerboseErrors = true;
        config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
        config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
    }
}
public class ODataV2Model
{
    public ODataV2Model()
    {
        Employees = new List<Employee>{
            new Employee { Id = 1, Name="Doug", EquipmentIds = new List<Equipment> { new Equipment { Id = 1 },new Equipment { Id = 2 } }.AsQueryable()},
            new Employee { Id = 2, Name= "George", EquipmentIds = new List<Equipment> {new Equipment { Id = 3}, new Equipment { Id = 5} }.AsQueryable() }
        }.AsQueryable();
    }
    public IQueryable<Employee> Employees { get; private set; }
    public IQueryable<Equipment> EquipmentIds { get; private set; }
}
[DataServiceKey("Id")]
public class Employee
{
    public int Id { get; set; }
    public string Name { get; set; }
    public IQueryable<Equipment> EquipmentIds { get; set; }
}
[DataServiceKey("Id")]
public class Equipment
{
    public int Id { get; set; }
}

When I run LinqPad on it, I get this:
Employees with 0 EquipmentIds on them

I should have both collections of EquipmentIds with counts of 2, but I have 0. I don’t receive an error, but the data never makes it to the client.

I switched to WCF Data Services v 5.0 and it works successfully on the .NET side, but I lose the ability to query with LinqPad. Is there a way for this to work in v 4.0?

If not, is there a way to upgrade LinqPad to recognize odata v3 (WCF Data Services 5.0)?

  • 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-06-02T06:52:33+00:00Added an answer on June 2, 2026 at 6:52 am

    The query ~/Employees will only include the Employee entities and not any navigation property content. This is to reduce the payload size. If you really want to include some of the navigation properties just specify for example ~/Employees?$expand=EquipmentIds.

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

Sidebar

Related Questions

Using WCF Data Services (and the latest Entity Framework), I want to return data
I have a Data Service created using WCF that internally uses nHibernate. This WCF
We have several Silverlight 4 apps running using WCF Data Services on our website.
I'm using WCF services in the client application for transfering data from client to
I've walked into a project that is using a WCF service for the data
I wrote a WCF service with a function that using absolute path to get
I am creating a WCF Data Service using the WCF Data Services Toolkit and
I have a WCF service operation that accepts a data contract parameter of custom
I have a pretty simple setup that I cannot get to work in silverlight.
I load data into my grid using a WCF service. When a user clicks

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.