Answers for "include inside include linq"

C#
3

C# linq include

//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();
Posted by: Guest on October-07-2020
0

C# linq include

var customers = context.Customers.ToList();
Posted by: Guest on March-31-2022

C# Answers by Framework

Browse Popular Code Answers by Language