Skip to content

Commit 0e9b85c

Browse files
add .NET 7 LINQ Order method
1 parent 4e704e2 commit 0e9b85c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

1_CS/LINQ/EnumerableSample/EnumerableSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net7.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="System.CommandLine" Version="2.0.0-beta3.22114.1" />
11+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

1_CS/LINQ/EnumerableSample/SortingSamples.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
class SortingSamples
44
{
5+
// .NET 7 update
6+
public static void SortDefault()
7+
{
8+
Console.WriteLine("Sort all the racers by the default sort as implemented in the Racer type");
9+
Console.WriteLine();
10+
11+
var racers = Formula1.GetChampions().Order().Take(10);
12+
13+
foreach (var racer in racers)
14+
{
15+
Console.WriteLine($"{racer.LastName}, {racer.FirstName}");
16+
}
17+
}
18+
519
public static void SortMultiple()
620
{
721
Console.WriteLine("Show the first 10 champions ordered by country, lastname, firstname");

0 commit comments

Comments
 (0)