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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:58:00+00:00 2026-06-17T17:58:00+00:00

I get an entity list by following: var riscregions = db.RiscEntranceDetails.OrderBy(r => r.RiscEntranceID).Include(r =>

  • 0

I get an entity list by following:

var riscregions = db.RiscEntranceDetails.OrderBy(r => r.RiscEntranceID).Include(r => r.RiscEntrance).Include(r => r.RiscRegion);

However, I need to reach more deeply related entities attributes, such as:

<td>@item.RiscEntrance.ID</td>
<td>@item.RiscEntrance.Personnel.Name</td>
<td>@item.RiscEntrance.EntranceDateTime</td>
<td>@item.RiscEntrance.ShiftWork.ShiftGroup.TextID</td>

How can I reach those? Any suggestions including linq, or some other workarounds such as extensions and helpers are greatly appreciated.

  • 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-17T17:58:01+00:00Added an answer on June 17, 2026 at 5:58 pm

    You can do this:

    var riscregions = db.RiscEntranceDetails
                    .OrderBy(r => r.RiscEntranceID)
                    .Include(r => r.RiscEntrance)
                    .Include(r => r.RiscEntrance.Personnel)
                    .Include(r => r.RiscEntrance.ShiftWork.ShiftGroup)
    

    You need to use Select in your Include expression only if you need to select children of a collection.

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

Sidebar

Related Questions

I get an InvalidCastException converting a linq entity list to a businessobject list using
I need to list all the orders with their corresponding customer ID using Entity
I have the following code - var db = new DBEntities(); var entity =
Given the following class public class Entity { public IList<Tag> Tags { get; set;
I want to get an entity with its sub-properties. How can I do that
How can I get an entity manager in a normal java class? I tried
Can someone tell me how can I get MS Entity Framework working with PostgreSQL.
Problem When executing a get for an entity with a many-to-one relationship with outer
I get a simple DTO entity A loaded into my upshot viewmodel which is
Using Entity Framework, I suddenly get this strange error after publishing my asp.net mvc

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.