Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 1.02 KB

create-a-nested-group.md

File metadata and controls

29 lines (23 loc) · 1.02 KB
title description keywords author manager ms.author ms.date ms.topic ms.prod ms.technology ms.devlang ms.assetid
Create a nested group
How to create a nested group.
.NET, .NET Core, C#
stevehoag
wpickett
wiwagn
12/1/2016
article
.net-core
.net-core-technologies
dotnet
e9f00708-362e-4d13-98c5-d77549347ba0

Create a nested group

The following example shows how to create nested groups in a LINQ query expression. Each group that is created according to student year or grade level is then further subdivided into groups based on the individuals' names.

Example

Note

This example contains references to objects that are defined in the sample code in Query a collection of objects.

[!code-cscsProgGuideLINQ#24]

Note that three nested foreach loops are required to iterate over the inner elements of a nested group.

See also

LINQ Query Expressions