Skip to content
Open
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
69f41a8
Update access-modifiers.md
bigboybamo Jun 11, 2024
b0e8850
Merge branch 'dotnet:main' into main
bigboybamo Jul 2, 2024
9afec84
Merge branch 'dotnet:main' into main
bigboybamo Aug 14, 2024
52abccd
Merge branch 'dotnet:main' into main
bigboybamo Aug 14, 2024
1706ff9
Merge branch 'dotnet:main' into main
bigboybamo Oct 1, 2024
8f859cb
Merge branch 'dotnet:main' into main
bigboybamo Oct 7, 2024
b638380
Merge branch 'dotnet:main' into main
bigboybamo Oct 10, 2024
f2a5570
Merge branch 'dotnet:main' into main
bigboybamo Nov 18, 2024
64c4bf8
Merge branch 'dotnet:main' into main
bigboybamo Dec 12, 2024
f66fddb
Merge branch 'dotnet:main' into main
bigboybamo Mar 11, 2025
78d4328
Merge branch 'dotnet:main' into main
bigboybamo Mar 21, 2025
ff4942a
Merge branch 'dotnet:main' into main
bigboybamo Mar 22, 2025
3042dbd
Merge branch 'dotnet:main' into main
bigboybamo Apr 5, 2025
bde738f
Merge branch 'dotnet:main' into main
bigboybamo Jun 9, 2025
9959d7a
Merge branch 'dotnet:main' into main
bigboybamo Jun 9, 2025
8ba2760
Merge branch 'dotnet:main' into main
bigboybamo Jul 2, 2025
995a0ec
Merge branch 'dotnet:main' into main
bigboybamo Jul 8, 2025
a9d399e
Merge branch 'dotnet:main' into main
bigboybamo Jul 31, 2025
68e5219
Merge branch 'dotnet:main' into main
bigboybamo Aug 21, 2025
a72eede
Merge branch 'dotnet:main' into main
bigboybamo Sep 25, 2025
7cd0684
Merge branch 'dotnet:main' into main
bigboybamo Oct 4, 2025
e1545bb
Merge branch 'dotnet:main' into main
bigboybamo Oct 8, 2025
d631fdd
Merge branch 'dotnet:main' into main
bigboybamo Nov 3, 2025
8ce5573
Merge branch 'dotnet:main' into main
bigboybamo Nov 10, 2025
4f82be0
Merge branch 'dotnet:main' into main
bigboybamo Nov 14, 2025
0b9e962
Merge branch 'dotnet:main' into main
bigboybamo Dec 9, 2025
046016f
Merge branch 'dotnet:main' into main
bigboybamo Feb 3, 2026
fb080e1
Introduce Student class for collection querying example
bigboybamo Feb 3, 2026
0d46d00
Remove Student class definition from LINQ example
bigboybamo Feb 3, 2026
9f8692c
Format Student record definition for clarity
bigboybamo Feb 3, 2026
5009fcf
Enhance LINQ documentation with code examples
bigboybamo Feb 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/csharp/linq/how-to-query-collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ The second, *scores.csv*, contains student IDs in the first column, followed by

The following example shows how to use a named record `Student` to store merged data from two in-memory collections of strings that simulate spreadsheet data in .csv format. The ID is used as the key to map students to their scores.

```csharp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a record, and we should be able to include it as a snippet from the file in ./snippets/How-to-collections/Program.cs at line 273.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BillWagner I've updated the PR now

public class Student
{
public int ID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int[] ExamScores { get; set; }

public Student(int ID, string FirstName, string LastName, int[] ExamScores)
{
this.ID = ID;
this.FirstName = FirstName;
this.LastName = LastName;
this.ExamScores = ExamScores;
}
}
```

:::code language="csharp" source="./snippets/HowToCollections/Program.cs" id="PopulateCollection":::

In the [select](../language-reference/keywords/select-clause.md) clause, each new `Student` object is initialized from the data in the two sources.
Expand Down