C#C
C#3y ago
127001

❔ EF | Get N level associated data

var data = dbContext.Orders
                .Include(x => x.OrderLines)
                    .ThenInclude(x => x.Product)
                    .ThenInclude(x => x.Category)
                .Include(x => x.Customer)
                .Include(x => x.Address)
                .ToList();

Data association is: Order -> OrderLine -> Product -> Category & ProductAdditionalInfos
Products table has association to (1-N) ProductAdditionalInfos table which contains some information like Color, Size etc.
How can I also add in this query ?
Was this page helpful?