Question : C# linq include
Answered by : robin-dittrich
//If you have a Customer model that contains a list of orders.
//You can include the orders like this
var customersWithOrders = _dbContext.Customers .Include(c => c.Orders) .ToList();
//Lets say those orders then contain products. You can include those like so:
var customersWithOrdersAndProducts = _dbContext.Customers .Include(c => c.Orders) .ThenInclude(o => o.Products) .ToList();
Source : | Last Update : Wed, 14 Oct 20
Question : C# linq include
Answered by : wrong-wombat-4j3np9g5v2c1
var customers = context.Customers.ToList();
Source : https://w3programmers.org/questions/26661771/What-does-Include-do-in-LINQ | Last Update : Thu, 07 Apr 22