From 0fd79f523943170fd9d1f94589427a5f1aeead01 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Oct 2025 10:20:30 +0000 Subject: [PATCH 1/6] Initial plan From 03edf4e6310bf626231971d05f663357add24dc8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Oct 2025 10:36:48 +0000 Subject: [PATCH 2/6] Update .NET dependencies to C# 13.0 and .NET 9.0 Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com> --- Common.props | 2 +- Directory.Build.props | 2 +- global.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Common.props b/Common.props index e85e8f5d9..1c1ebc0a8 100644 --- a/Common.props +++ b/Common.props @@ -1,5 +1,5 @@ - net8.0;net7.0;net6.0 + net9.0;net8.0 \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index ff109418b..d26b9ce6a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 12.0 + 13.0 enable enable true diff --git a/global.json b/global.json index d4e0b8993..00e5df373 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.0", + "version": "9.0.0", "rollForward": "latestFeature", "allowPrerelease": true } From f5f79e217d0e20464586c8da98a6fcf507e1e47a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Oct 2025 10:58:44 +0000 Subject: [PATCH 3/6] Update documentation to reflect C# 13.0 and .NET 9.0 Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com> --- .github/actions/setup-dotnet/action.yml | 3 +-- Errata.md | 4 ++-- README.md | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-dotnet/action.yml b/.github/actions/setup-dotnet/action.yml index 01a84e329..930e76247 100644 --- a/.github/actions/setup-dotnet/action.yml +++ b/.github/actions/setup-dotnet/action.yml @@ -12,9 +12,8 @@ runs: uses: actions/setup-dotnet@v5 with: dotnet-version: | - 6.0.x - 7.0.x 8.0.x + 9.0.x - name: Set up dependency caching for faster builds uses: actions/cache@v4 diff --git a/Errata.md b/Errata.md index cb8f2de23..c75222034 100644 --- a/Errata.md +++ b/Errata.md @@ -1,6 +1,6 @@ -# Essential C# 12.0 Errata Document +# Essential C# 13.0 Errata Document -## Essential C# 12.0 +## Essential C# 13.0 by Mark Michaelis ISBN-13: 978-0138219512 diff --git a/README.md b/README.md index 05c2c1784..a0ecb9410 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This project contains the source code for the book **Essential C#** by Mark Mich ## Requirements -- [.NET](https://www.microsoft.com/net/core) - This project is currently tested against .NET 8.0, 7.0, and 6.0. +- [.NET](https://www.microsoft.com/net/core) - This project is currently tested against .NET 9.0 and 8.0. - [Visual Studio](https://visualstudio.microsoft.com/downloads/) - Already contains .NET Core to get up and running. Not to mention, it's a great IDE that makes it easy to get started. - [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - While not required, a good tool to get used to, and easy way to download this code repository quickly. [GitKraken](https://gitkraken.cello.so/tl7bYaRLgzT) is a great GUI for using Git if you prefer not using the command line. Visual Studio and VSCode also have ever improving git tooling built in. From 0ed56f3782f8cfdab54b8ddde4107863beedb906 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Fri, 3 Oct 2025 04:06:45 -0700 Subject: [PATCH 4/6] Update Errata.md --- Errata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Errata.md b/Errata.md index c75222034..8859a81d0 100644 --- a/Errata.md +++ b/Errata.md @@ -1,6 +1,6 @@ # Essential C# 13.0 Errata Document -## Essential C# 13.0 +## Essential C# 12.0 by Mark Michaelis ISBN-13: 978-0138219512 From 4f1ba520835ec654f42d6cab91a11f453b75cb5f Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Fri, 3 Oct 2025 04:06:52 -0700 Subject: [PATCH 5/6] Update Errata.md --- Errata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Errata.md b/Errata.md index 8859a81d0..cb8f2de23 100644 --- a/Errata.md +++ b/Errata.md @@ -1,4 +1,4 @@ -# Essential C# 13.0 Errata Document +# Essential C# 12.0 Errata Document ## Essential C# 12.0 From 86f647ffc197b75ca050df97ce09472f8fe1d880 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Fri, 3 Oct 2025 21:19:43 -0700 Subject: [PATCH 6/6] Update for .net 9.0 --- src/Chapter16.Tests/Listing16.15.Tests.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Chapter16.Tests/Listing16.15.Tests.cs b/src/Chapter16.Tests/Listing16.15.Tests.cs index d7ebcceb4..035e86961 100644 --- a/src/Chapter16.Tests/Listing16.15.Tests.cs +++ b/src/Chapter16.Tests/Listing16.15.Tests.cs @@ -13,7 +13,7 @@ public void SelectingAnonymousTypeFollowingGroupClause() string expected = dotnetCoreVersion switch { // Version <= 5 - string value when string.Compare(value, "6")<0 => """ + string value when string.Compare(value, "6") < 0 => """ Aggregate, All, Any, Append, AsEnumerable, Average, Cast, Concat, Contains, Count, DefaultIfEmpty, Distinct, ElementAt, ElementAtOrDefault, Empty, Except, First, FirstOrDefault, GroupBy, GroupJoin, Intersect, Join, Last, @@ -35,8 +35,8 @@ string value when value.StartsWith("6") => """ ThenByDescending, ToArray, ToDictionary, ToHashSet, ToList, ToLookup, TryGetNonEnumeratedCount, Union, UnionBy, Where, Zip, """, - // Version 7 - _ => """ + // Version 7-8 + string value when Version.TryParse(value, out var v) && (v.Major is 7 or 8) => """ Aggregate, All, Any, Append, AsEnumerable, Average, Cast, Chunk, Concat, Contains, Count, DefaultIfEmpty, Distinct, DistinctBy, ElementAt, ElementAtOrDefault, Empty, Except, ExceptBy, First, @@ -47,6 +47,19 @@ string value when value.StartsWith("6") => """ SingleOrDefault, Skip, SkipLast, SkipWhile, Sum, Take, TakeLast, TakeWhile, ThenBy, ThenByDescending, ToArray, ToDictionary, ToHashSet, ToList, ToLookup, TryGetNonEnumeratedCount, Union, UnionBy, Where, Zip, + """, + // Version 9 + _ => """ + Aggregate, AggregateBy, All, Any, Append, AsEnumerable, Average, Cast, + Chunk, Concat, Contains, Count, CountBy, DefaultIfEmpty, Distinct, DistinctBy, + ElementAt, ElementAtOrDefault, Empty, Except, ExceptBy, First, + FirstOrDefault, GroupBy, GroupJoin, Index, Intersect, IntersectBy, Join, + Last, LastOrDefault, LongCount, Max, MaxBy, Min, MinBy, OfType, + Order, OrderBy, OrderByDescending, OrderDescending, Prepend, Range, + Repeat, Reverse, Select, SelectMany, SequenceEqual, Single, + SingleOrDefault, Skip, SkipLast, SkipWhile, Sum, Take, TakeLast, + TakeWhile, ThenBy, ThenByDescending, ToArray, ToDictionary, ToHashSet, + ToList, ToLookup, TryGetNonEnumeratedCount, Union, UnionBy, Where, Zip, """ };