skip to Main Content

If we have some nested collection (navigation property) in the entity model and this navigation also has a navigation property, what can you load using Entity Framework with minimal performance penalty?

2

Answers


  1. Chosen as BEST ANSWER

    enter image description here

    as use see the name of the navigation matters


  2. You can use ThenInclude to load nested relations

    using (var context = new MyContext())
    {
        var customers = context.Customers
            .Include(i => i.Invoices)
                .ThenInclude(it => it.Items)
            .ToList();
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search