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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:49:43+00:00 2026-06-11T06:49:43+00:00

I have 3 tables. Incidents, Rootcauses, and IncidentRootCauses. The table incidentrootcauses is tied to

  • 0

I have 3 tables. Incidents, Rootcauses, and IncidentRootCauses. The table incidentrootcauses is tied to Incidents as a one to many. When I get the Incident object, There is not a list of rootcause objects as a I expected, instead I am getting (In my Immediate window)

var rt = incident.IncidentRootCauses;

{System.Data.Linq.EntitySet}
Count: 1

HasLoadedOrAssignedValues: true

IsDeferred: false

I would like to be able to load all of the rootcause objects when the query runs. I know the problem is that incident is not tied to the rootcause table explicitly. Thank you for any help with this.

using (var db = new IncidentTrackerDataContext())
            {
                var lo = new DataLoadOptions();
                lo.LoadWith<Incident>(incidents => incidents.ReportedTo);
                lo.LoadWith<Incident>(incidents => incidents.Shift);
                lo.LoadWith<Incident>(incidents => incidents.Machine);
                lo.LoadWith<Incident>(incidents => incidents.Department);
                lo.LoadWith<Incident>(incidents => incidents.IncidentRootCauses);
                lo.LoadWith<IncidentRootCause>(i => i.RootCause);

                // lo.LoadWith<Incident>(incidents => incidents.IncidentManagers);
                // lo.LoadWith<Incident>(incidents => incidents.IncidentMembers);
                // lo.LoadWith<Incident>(incidents => incidents.IncidentWitnesses);
                db.LoadOptions = lo;
                db.DeferredLoadingEnabled = false;
                Incident incident = (from i in db.Incidents
                                     where i.IncidentReportID == new Guid(incidentID)
                                     select i).FirstOrDefault();

                return incident;
            }
  • 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-11T06:49:45+00:00Added an answer on June 11, 2026 at 6:49 am

    It sounds like you also want a second level of eager loaded entities.

    On the same LoadOptions, try:

    lo.LoadWith<IncidentRootCause>(irc => irc.RootCause);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables set up in a many-to-many relationship: Incidents and Users. When
I have an Incident table with one row that has the value 'out of
I have table INCIDENT with rows TICKETID ACTUALFINISH TARGETFINISH 100 2012-03-01 11:11:11 2012-02-01 11:11:11
I have tables linked by FK, I query on the first table using entity
hi i have tables like this: Persons: person_id, name then i have many langauge
I have three tables, incidents , incident_properties and property_types . What I would like
Background I have a joined table consisting of Incidents, Customers, and Areas that I'm
I have tables as below table A emp_code | emp_name table B emp_code |
I have tables in a MySQL database like this... CREATE TABLE `someUserTable` ( userId
I have tables as below. Table Messages message_id parent_id forum_id user_id Table Users user_id

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.