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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:15:44+00:00 2026-05-29T06:15:44+00:00

The thing is that I’ve a Odata service with a default configuration: public class

  • 0

The thing is that I’ve a Odata service with a default configuration:

public class Service : DataService<SummumnetFilterContext>
    {
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {

            config.SetEntitySetAccessRule("*", EntitySetRights.All);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;

        }
        protected override SummumnetFilterContext CreateDataSource()
        {
           var dataSource = new SummumnetFilterContext();
           dataSource.Configuration.ProxyCreationEnabled = false;
           return dataSource;
        }
    }

And a couple of tables with this structure:

 public class LabTest
    {
        public int ID { get; set; }
        public DateTime ApplicationDate { get; set; }
        public DateTime ReportDate { get; set; }

        public virtual List<LabValue> LabValue { get; set; }
    }
 public class LabValue
    {
        [Required]
        public int ID { get; set; }
        public string Value { get; set; }
        public string Units { get; set; }

        public int LabTestID { get; set; }
        public virtual LabTest LabTest { get; set; } 
    }

The thing is, that when I’m trying to retrive any LabTest, with it’s LabValue, using Odata the List<LabValue> LabValues comes empty every time, not null, but empty. Can any one help me with this?. At my service y use EF ofcourse.

  • 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-29T06:15:45+00:00Added an answer on May 29, 2026 at 6:15 am

    I guess you are using WCF Data Services to consume your OData feed. In such case you must tell the service that you want your relation to be loaded together with the main entity:

    var data = dataServiceContext.LabTests.Expand("LabValues").FirstOrDefault();
    

    If you call the data service manually through URL you must use expand query option.

    To make it clear – there is no transparent lazy loading for the service. Lazy loading is EF feature used when you work directly with the entity on the same tier in scope of current EF context. When you consume OData feed you are most probably not on the same tier (even machine) and transparent lazy loading is not offered to avoid additional network roundtrips to the service.

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

Sidebar

Related Questions

one thing that i always wondered, if i have a method like this: String
Just a thing that annoys me. When I right click on a method name
I have this thing that i need to do and some advices will be
I have this weird thing that I'm running into. Basically, in FF9.0.1, dragleave doesn't
This is the weirdest thing that has ever happened to me since I am
Seems like this is the kind of thing that would have already been answered
This seems like a really basic thing that I'm doing, yet I'm tearing my
the thing that we do in xaml like this <Image Height=136 HorizontalAlignment=Center x:Name=image1 Stretch=Fill
Hey I am stuck with 1 thing that I want a view like this
The only thing that I miss about using other editors is finding my place

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.