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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:32:12+00:00 2026-05-31T23:32:12+00:00

In my repository, I get data from my TransportedMaterial table. I also ‘include’ TransportedMaterialPacking

  • 0

In my repository, I get data from my TransportedMaterial table. I also ‘include’ TransportedMaterialPacking to retrieve all related data in this linked table. In this last table I also would like to retrieve the related MaterialPacking data. I don’t know how?

enter image description here

On the picture above we see that the MaterialPacking is null (it has not been filled).

Here are the models:

public class TransportedMaterialPacking
{
    public int TransportedMaterialPackingID { get; set; }
    public MaterialPacking MaterialPacking { get; set; }
    public double Quantity { get; set; }
    public double? Width { get; set; }
    public double? Height { get; set; }
    public double? Length { get; set; }
}

public class MaterialPacking
{
    public int MaterialPackingID { get; set; }
    public string DescriptionFr { get; set; }
    public string DescriptionNl { get; set; }
}

The relations are like this:

TransportedMaterial >> TransportedMaterialPacking >> MaterialPacking

public static class ORMExtensions
{
    public static IQueryable<T> MyInclude<T, C>(this IQueryable<T> source, Expression<Func<T, C>> function)
        where C : class
        where T : class
    {
        return source.Include(function);
    }

I use Entity framework.

Thanks.

  • 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-31T23:32:13+00:00Added an answer on May 31, 2026 at 11:32 pm

    You can ‘cascade’ include by doing something like foo.Include("NavigationProperty.SubNavigationProperty") in your query.

    Edit Using property notation to include navigation subproperties is possible, see this for example.

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

Sidebar

Related Questions

Almost all of the applications I write at work get their data from a
i have a linq query to get data from a database. something like: Repository.Query<Project>.Where(r=>r.IsActive).OrderBy(r=>r.Date);
In our application we use the repository pattern to retrieve and persist data from
How can I iterate throw mapped entities and get all data from database? I
I get a list of items from my Repository. Now I need to sort
Is there a way to get the Tortoisehg repository explorer to start from a
Is there any to get the entire remote repository, say from http://repo1.maven.org/maven2/ , to
I'd really like to get our host to pull from our Git repository instead
Have problem while getting data from Memcached on .NET MVC solution. I have this
In one of my current applications, I need to get customer data from a

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.