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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:48:52+00:00 2026-06-09T21:48:52+00:00

When using Include() in my LINQ against my model should the path parameter I

  • 0

When using Include() in my LINQ against my model should the path parameter I supply be the name of the related objects or the name of the Navigation Property?

I ask because the same table has more than one relationship to the same other table. I note in the designer the navigation properties of related table are in the form:

RelatedTable
RelatedTable1
...
RelatedTablen

Lazy loading is off so I need to explicitly load related objects. I am only want the objects related through the Navigation Property: “RelatedTable1” I have tried supplying the Navigation Property name (i.e. “RelatedTable1”) to Include, i.e.:

from row in Table.Include("RelatedTable1")
select row

and it works! Which suggests the path parameter should be the name of the Navigation Property. However I have also tried just the related Entity’s name, i.e.:

from row in Table.Include("RelatedTable")
select row

and it works too! I am just asking to understand what is going on..

(LazyLoading is off and if I do not use Include() related is not fetched).

  • 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-09T21:48:52+00:00Added an answer on June 9, 2026 at 9:48 pm

    You can use the name of the Navigation properties, or you can chain them like this:

    db.Tables.Include("RelatedTable.RelatedTable2");
    

    Or if you prefer strongly typing, you could include as a lambda:

    db.Tables.Include(x => x.RelatedTable);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've checked lots of tutorials about including header, navigation and footer using php include.
I am using L2S and an inheritance model for mapping Persons against certain roles.
Using Linq to SQL How does one query and match to include all rows
I'm tring to implement LINQ to Entity using Include extension. I have the following
When I try to include a file using include_once in php which shows warning
I'm using OpenCV v2.4.1 And this is the code I'm using #include opencv2/opencv.hpp #include
Probably a dumb question, but is it still using Include files?
I am using an include file by doing: <!--#include virtual=/includes/leftNav.shtml--> I changed the include
In PHP when using the include function is the a way to tell from
I am trying to make my code more clear using the include function of

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.