diff --git a/.github/actions/setup-dotnet/action.yml b/.github/actions/setup-dotnet/action.yml index 01a84e32..930e7624 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/Common.props b/Common.props index e85e8f5d..1c1ebc0a 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 ff109418..d26b9ce6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 12.0 + 13.0 enable enable true diff --git a/README.md b/README.md index 05c2c178..a0ecb941 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. diff --git a/global.json b/global.json index d4e0b899..00e5df37 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.0", + "version": "9.0.0", "rollForward": "latestFeature", "allowPrerelease": true } diff --git a/src/Chapter16.Tests/Listing16.15.Tests.cs b/src/Chapter16.Tests/Listing16.15.Tests.cs index d7ebcceb..035e8696 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, """ };