From 57dfc52b41c621c60d6e7c7d46c6d9e866853203 Mon Sep 17 00:00:00 2001 From: Jeremy Knight <492328+jeremyknight-me@users.noreply.github.com> Date: Sat, 13 Jan 2024 16:27:47 -0600 Subject: [PATCH 1/6] added dotnet8 to fluentvalidation --- .../JK.Common.FluentValidation.Tests.csproj | 10 ++++++---- src/JK.Common.FluentValidation/CHANGELOG.md | 12 +++++++++--- .../JK.Common.FluentValidation.csproj | 10 +++++----- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/JK.Common.FluentValidation.Tests/JK.Common.FluentValidation.Tests.csproj b/src/JK.Common.FluentValidation.Tests/JK.Common.FluentValidation.Tests.csproj index 3653b7e..6616f8d 100644 --- a/src/JK.Common.FluentValidation.Tests/JK.Common.FluentValidation.Tests.csproj +++ b/src/JK.Common.FluentValidation.Tests/JK.Common.FluentValidation.Tests.csproj @@ -1,16 +1,18 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 enable false - - - + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/JK.Common.FluentValidation/CHANGELOG.md b/src/JK.Common.FluentValidation/CHANGELOG.md index e26b074..4a4bec7 100644 --- a/src/JK.Common.FluentValidation/CHANGELOG.md +++ b/src/JK.Common.FluentValidation/CHANGELOG.md @@ -9,17 +9,23 @@ Unless otherwise noted, all changes made by [@jeremyknight-me](https://github.co ## Unreleased +Nothing at this time. + +## 3.1.0 + +### Added + +- Added .NET 7 and .NET 8 to multi-targeting + ### Changed -- Added .NET 7 to multi-targeting - Upgraded FluentValidation from 10.x to 11.x -- Upgraded JK.Common to 5.0.0 +- Upgraded JK.Common to 5.2.0 ### Removed - Removed .NET Standard 2.1 and .NET 5 from multi-targetting - ## 3.0.0 ### Added diff --git a/src/JK.Common.FluentValidation/JK.Common.FluentValidation.csproj b/src/JK.Common.FluentValidation/JK.Common.FluentValidation.csproj index 66975c9..fcac812 100644 --- a/src/JK.Common.FluentValidation/JK.Common.FluentValidation.csproj +++ b/src/JK.Common.FluentValidation/JK.Common.FluentValidation.csproj @@ -1,11 +1,11 @@  - 10.0 - netstandard2.0;net6.0;net7.0 + 12.0 + netstandard2.0;net6.0;net7.0;net8.0 true false - 3.0.0 + 3.1.0 LICENSE A utility library containing extensions to FluentValidation Jeremy Knight @@ -16,8 +16,8 @@ - - + + From 33a3868490f3e9b43c0157d1ef844d73b1b0b66d Mon Sep 17 00:00:00 2001 From: Jeremy Knight <492328+jeremyknight-me@users.noreply.github.com> Date: Sat, 13 Jan 2024 16:32:49 -0600 Subject: [PATCH 2/6] added dotnet8 support to data.sql library --- .../JK.Common.Data.Sql.Tests.csproj | 10 ++--- src/JK.Common.Data.Sql/CHANGELOG.md | 10 +++++ .../JK.Common.Data.Sql.csproj | 42 +++++++++---------- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/JK.Common.Data.Sql.Tests/JK.Common.Data.Sql.Tests.csproj b/src/JK.Common.Data.Sql.Tests/JK.Common.Data.Sql.Tests.csproj index eb4a280..0c12120 100644 --- a/src/JK.Common.Data.Sql.Tests/JK.Common.Data.Sql.Tests.csproj +++ b/src/JK.Common.Data.Sql.Tests/JK.Common.Data.Sql.Tests.csproj @@ -1,15 +1,15 @@  - 11.0 - net48;net6.0;net7.0 + 12.0 + net48;net6.0;net7.0;net8.0 false - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/JK.Common.Data.Sql/CHANGELOG.md b/src/JK.Common.Data.Sql/CHANGELOG.md index cde1697..b69ee4b 100644 --- a/src/JK.Common.Data.Sql/CHANGELOG.md +++ b/src/JK.Common.Data.Sql/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Unless otherwise noted, all changes made by [@jeremyknight-me](https://github.com/jeremyknight-me). +## 5.2.0 + +### Added + +- Added support for .NET 8 + +### Changed + +- Upgraded `JK.Common.Abstractions` to v1.1.0 + ## 5.1.0 ### Added diff --git a/src/JK.Common.Data.Sql/JK.Common.Data.Sql.csproj b/src/JK.Common.Data.Sql/JK.Common.Data.Sql.csproj index bebea03..32c30c1 100644 --- a/src/JK.Common.Data.Sql/JK.Common.Data.Sql.csproj +++ b/src/JK.Common.Data.Sql/JK.Common.Data.Sql.csproj @@ -1,27 +1,27 @@  - - 11.0 - netstandard2.0;net6.0;net7.0 - Jeremy Knight - 5.1.0 - Copyright Jeremy Knight. All rights reserved. - A utility library containing extensions to System.Data.SqlClient - LICENSE - https://github.com/jeremyknight-me/JK.Common - https://github.com/jeremyknight-me/JK.Common - + + 12.0 + netstandard2.0;net6.0;net7.0;net8.0 + Jeremy Knight + 5.2.0 + Copyright Jeremy Knight. All rights reserved. + A utility library containing extensions to System.Data.SqlClient + LICENSE + https://github.com/jeremyknight-me/JK.Common + https://github.com/jeremyknight-me/JK.Common + - - - - + + + + - - - True - - - + + + True + + + From d703aab1e7c9992fc63ffe670d196318e8d486a1 Mon Sep 17 00:00:00 2001 From: Jeremy Knight <492328+jeremyknight-me@users.noreply.github.com> Date: Sat, 13 Jan 2024 16:52:23 -0600 Subject: [PATCH 3/6] updated efcore library to dotnet8 --- ...JK.Common.EntityFrameworkCore.Tests.csproj | 22 +++++++++---------- .../CHANGELOG.md | 6 +++++ .../JK.Common.EntityFrameworkCore.csproj | 18 +++++++-------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/JK.Common.EntityFrameworkCore.Tests/JK.Common.EntityFrameworkCore.Tests.csproj b/src/JK.Common.EntityFrameworkCore.Tests/JK.Common.EntityFrameworkCore.Tests.csproj index 81edf2d..f391f7e 100644 --- a/src/JK.Common.EntityFrameworkCore.Tests/JK.Common.EntityFrameworkCore.Tests.csproj +++ b/src/JK.Common.EntityFrameworkCore.Tests/JK.Common.EntityFrameworkCore.Tests.csproj @@ -1,15 +1,15 @@  - 10.0 - net6.0;net7.0 + 12.0 + net6.0;net7.0;net8.0 false - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -19,14 +19,14 @@ - - - + + + - - - + + + diff --git a/src/JK.Common.EntityFrameworkCore/CHANGELOG.md b/src/JK.Common.EntityFrameworkCore/CHANGELOG.md index 0f6d0e2..7e225b8 100644 --- a/src/JK.Common.EntityFrameworkCore/CHANGELOG.md +++ b/src/JK.Common.EntityFrameworkCore/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Unless otherwise noted, all changes made by [@jeremyknight-me](https://github.com/jeremyknight-me). +## 4.1.0 + +### Added + +- Added support for .NET 8 + ## 4.0.0 ### Added diff --git a/src/JK.Common.EntityFrameworkCore/JK.Common.EntityFrameworkCore.csproj b/src/JK.Common.EntityFrameworkCore/JK.Common.EntityFrameworkCore.csproj index 03feeff..4f14c42 100644 --- a/src/JK.Common.EntityFrameworkCore/JK.Common.EntityFrameworkCore.csproj +++ b/src/JK.Common.EntityFrameworkCore/JK.Common.EntityFrameworkCore.csproj @@ -1,14 +1,14 @@  - 10.0 - netstandard2.0;net6.0;net7.0 + 12.0 + netstandard2.0;net6.0;net7.0;net8.0 true false A utility library containing extensions to Microsoft.EntityFrameworkCore https://github.com/jeremyknight-me/JK.Common - 4.0.0.0 - 4.0.0 + 4.1.0.0 + 4.1.0 Jeremy Knight LICENSE Copyright Jeremy Knight. All rights reserved. @@ -16,15 +16,15 @@ - + - - + + - - + + From 83a101f6c3eb3161fa4eae5993dba6ac8e021bbd Mon Sep 17 00:00:00 2001 From: Jeremy Knight <492328+jeremyknight-me@users.noreply.github.com> Date: Sat, 13 Jan 2024 17:00:19 -0600 Subject: [PATCH 4/6] added dotnet to efcore.sqlserver library --- .../CHANGELOG.md | 10 ++++++++++ ...ommon.EntityFrameworkCore.SqlServer.csproj | 20 ++++++++----------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/JK.Common.EntityFrameworkCore.SqlServer/CHANGELOG.md b/src/JK.Common.EntityFrameworkCore.SqlServer/CHANGELOG.md index 3d0fe43..51ba516 100644 --- a/src/JK.Common.EntityFrameworkCore.SqlServer/CHANGELOG.md +++ b/src/JK.Common.EntityFrameworkCore.SqlServer/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Unless otherwise noted, all changes made by [@jeremyknight-me](https://github.com/jeremyknight-me). +## 3.2.0 + +### Added + +- Support for .NET 7 and .NET 8 + +### Removed + +- Support for .NET 5 and .NET Standard 2.1 + ## 3.1.0 ### Added diff --git a/src/JK.Common.EntityFrameworkCore.SqlServer/JK.Common.EntityFrameworkCore.SqlServer.csproj b/src/JK.Common.EntityFrameworkCore.SqlServer/JK.Common.EntityFrameworkCore.SqlServer.csproj index 70eb144..7c7b1d0 100644 --- a/src/JK.Common.EntityFrameworkCore.SqlServer/JK.Common.EntityFrameworkCore.SqlServer.csproj +++ b/src/JK.Common.EntityFrameworkCore.SqlServer/JK.Common.EntityFrameworkCore.SqlServer.csproj @@ -1,11 +1,11 @@  - 10.0 - netstandard2.0;netstandard2.1;net5.0;net6.0 + 12.0 + netstandard2.0;net6.0;net7.0;net8.0 true false - 3.1.0 + 3.2.0 Jeremy Knight Jeremy Knight A utility library containing extensions to Microsoft.EntityFrameworkCore.SqlServer @@ -15,20 +15,16 @@ https://github.com/jeremyknight-me/JK.Common - - + + - - - - - - + + - + From 3dcfff46a01572d7246c613e750373b39b8b0138 Mon Sep 17 00:00:00 2001 From: Jeremy Knight <492328+jeremyknight-me@users.noreply.github.com> Date: Sat, 13 Jan 2024 17:08:49 -0600 Subject: [PATCH 5/6] ran code cleanup tool --- .../Extensions/PropertyBuilderDateExtensions.cs | 4 ++-- .../Extensions/PropertyBuilderExtensions.cs | 4 ++-- src/JK.Common.EntityFrameworkCore.Tests/Usings.cs | 4 ++-- src/JK.Common.EntityFrameworkCore/ChangeTrackerExtensions.cs | 4 ++-- src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs | 4 ++-- .../Validators/LatitudeValidator.cs | 4 ++-- .../Validators/LongitudeValidator.cs | 4 ++-- src/JK.Common.FluentValidation/Validators/SqlDateValidator.cs | 4 ++-- src/JK.Common.Tests/Converters/DistanceConverterTests.cs | 4 ++-- src/JK.Common.Tests/TypeHelpers/EnumHelperTests.cs | 4 ++-- src/JK.Common/Converters/DistanceConverter.cs | 4 ++-- src/JK.Common/Data/DatabaseValueParser.cs | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/JK.Common.EntityFrameworkCore.SqlServer/Extensions/PropertyBuilderDateExtensions.cs b/src/JK.Common.EntityFrameworkCore.SqlServer/Extensions/PropertyBuilderDateExtensions.cs index 9de745e..b10746d 100644 --- a/src/JK.Common.EntityFrameworkCore.SqlServer/Extensions/PropertyBuilderDateExtensions.cs +++ b/src/JK.Common.EntityFrameworkCore.SqlServer/Extensions/PropertyBuilderDateExtensions.cs @@ -1,5 +1,5 @@ -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System; +using System; +using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace JK.Common.EntityFrameworkCore.SqlServer.Extensions; diff --git a/src/JK.Common.EntityFrameworkCore.SqlServer/Extensions/PropertyBuilderExtensions.cs b/src/JK.Common.EntityFrameworkCore.SqlServer/Extensions/PropertyBuilderExtensions.cs index 0ffcf50..80c44f2 100644 --- a/src/JK.Common.EntityFrameworkCore.SqlServer/Extensions/PropertyBuilderExtensions.cs +++ b/src/JK.Common.EntityFrameworkCore.SqlServer/Extensions/PropertyBuilderExtensions.cs @@ -1,5 +1,5 @@ -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System; +using System; +using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace JK.Common.EntityFrameworkCore.SqlServer.Extensions; diff --git a/src/JK.Common.EntityFrameworkCore.Tests/Usings.cs b/src/JK.Common.EntityFrameworkCore.Tests/Usings.cs index 879cbdd..84f9362 100644 --- a/src/JK.Common.EntityFrameworkCore.Tests/Usings.cs +++ b/src/JK.Common.EntityFrameworkCore.Tests/Usings.cs @@ -1,4 +1,4 @@ -global using Microsoft.EntityFrameworkCore; -global using System; +global using System; global using System.ComponentModel.DataAnnotations; +global using Microsoft.EntityFrameworkCore; global using Xunit; diff --git a/src/JK.Common.EntityFrameworkCore/ChangeTrackerExtensions.cs b/src/JK.Common.EntityFrameworkCore/ChangeTrackerExtensions.cs index b53bf6f..372e5f5 100644 --- a/src/JK.Common.EntityFrameworkCore/ChangeTrackerExtensions.cs +++ b/src/JK.Common.EntityFrameworkCore/ChangeTrackerExtensions.cs @@ -1,6 +1,6 @@ -using Microsoft.EntityFrameworkCore; +using System; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; -using System; namespace JK.Common.EntityFrameworkCore; diff --git a/src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs b/src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs index 1b191a6..c3b2855 100644 --- a/src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs +++ b/src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs @@ -1,7 +1,7 @@ -using Microsoft.EntityFrameworkCore; -using System; +using System; using System.Threading; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; namespace JK.Common.EntityFrameworkCore; diff --git a/src/JK.Common.FluentValidation/Validators/LatitudeValidator.cs b/src/JK.Common.FluentValidation/Validators/LatitudeValidator.cs index 285932b..d21a1e0 100644 --- a/src/JK.Common.FluentValidation/Validators/LatitudeValidator.cs +++ b/src/JK.Common.FluentValidation/Validators/LatitudeValidator.cs @@ -1,7 +1,7 @@ using System; -using JK.Common.Specifications; -using FluentValidation.Validators; using FluentValidation; +using FluentValidation.Validators; +using JK.Common.Specifications; namespace JK.Common.FluentValidation.Validators; diff --git a/src/JK.Common.FluentValidation/Validators/LongitudeValidator.cs b/src/JK.Common.FluentValidation/Validators/LongitudeValidator.cs index 7b44285..08e36b1 100644 --- a/src/JK.Common.FluentValidation/Validators/LongitudeValidator.cs +++ b/src/JK.Common.FluentValidation/Validators/LongitudeValidator.cs @@ -1,7 +1,7 @@ using System; -using JK.Common.Specifications; -using FluentValidation.Validators; using FluentValidation; +using FluentValidation.Validators; +using JK.Common.Specifications; namespace JK.Common.FluentValidation.Validators; diff --git a/src/JK.Common.FluentValidation/Validators/SqlDateValidator.cs b/src/JK.Common.FluentValidation/Validators/SqlDateValidator.cs index e781dcf..e79d72b 100644 --- a/src/JK.Common.FluentValidation/Validators/SqlDateValidator.cs +++ b/src/JK.Common.FluentValidation/Validators/SqlDateValidator.cs @@ -1,7 +1,7 @@ using System; -using JK.Common.Specifications; -using FluentValidation.Validators; using FluentValidation; +using FluentValidation.Validators; +using JK.Common.Specifications; namespace JK.Common.FluentValidation.Validators; diff --git a/src/JK.Common.Tests/Converters/DistanceConverterTests.cs b/src/JK.Common.Tests/Converters/DistanceConverterTests.cs index e14797a..832b4a4 100644 --- a/src/JK.Common.Tests/Converters/DistanceConverterTests.cs +++ b/src/JK.Common.Tests/Converters/DistanceConverterTests.cs @@ -1,6 +1,6 @@ -using JK.Common.Converters; +using System.Collections.Generic; +using JK.Common.Converters; using JK.Common.Enumerations; -using System.Collections.Generic; namespace JK.Common.Tests.Converters; diff --git a/src/JK.Common.Tests/TypeHelpers/EnumHelperTests.cs b/src/JK.Common.Tests/TypeHelpers/EnumHelperTests.cs index a972c59..808590b 100644 --- a/src/JK.Common.Tests/TypeHelpers/EnumHelperTests.cs +++ b/src/JK.Common.Tests/TypeHelpers/EnumHelperTests.cs @@ -1,7 +1,7 @@ -using JK.Common.TypeHelpers; -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using JK.Common.TypeHelpers; namespace JK.Common.Tests.TypeHelpers; diff --git a/src/JK.Common/Converters/DistanceConverter.cs b/src/JK.Common/Converters/DistanceConverter.cs index 0e2cae7..fb2fe4d 100644 --- a/src/JK.Common/Converters/DistanceConverter.cs +++ b/src/JK.Common/Converters/DistanceConverter.cs @@ -1,6 +1,6 @@ -using JK.Common.Enumerations; -using System; +using System; using System.Collections.Generic; +using JK.Common.Enumerations; namespace JK.Common.Converters; diff --git a/src/JK.Common/Data/DatabaseValueParser.cs b/src/JK.Common/Data/DatabaseValueParser.cs index e28b337..64f6d6c 100644 --- a/src/JK.Common/Data/DatabaseValueParser.cs +++ b/src/JK.Common/Data/DatabaseValueParser.cs @@ -13,7 +13,7 @@ public static class DatabaseValueParser /// Type of object. /// Object to test. /// Object's type default if DBNull, otherwise the object's value. - public static T GetValueOrDefault(object value) => Convert.IsDBNull(value) ? default(T) : (T)value; + public static T GetValueOrDefault(object value) => Convert.IsDBNull(value) ? default : (T)value; /// /// Gets the value of an object or returns the given default value. From 8d0750fee0070053a56937bd0569182b29c7e4ac Mon Sep 17 00:00:00 2001 From: Jeremy Knight <492328+jeremyknight-me@users.noreply.github.com> Date: Sat, 13 Jan 2024 17:24:55 -0600 Subject: [PATCH 6/6] refactored out GetUninitializedObjectHelper --- .../TestUtils/GetUninitializedObjectHelper.cs | 25 +++++++++++++++++++ .../TestUtils/UnsafeSqlExceptionFactory.cs | 4 +-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/JK.Common.Data.Sql.Tests/TestUtils/GetUninitializedObjectHelper.cs rename src/{JK.Common.Data.Sql => JK.Common.Data.Sql.Tests}/TestUtils/UnsafeSqlExceptionFactory.cs (95%) diff --git a/src/JK.Common.Data.Sql.Tests/TestUtils/GetUninitializedObjectHelper.cs b/src/JK.Common.Data.Sql.Tests/TestUtils/GetUninitializedObjectHelper.cs new file mode 100644 index 0000000..a5c2d89 --- /dev/null +++ b/src/JK.Common.Data.Sql.Tests/TestUtils/GetUninitializedObjectHelper.cs @@ -0,0 +1,25 @@ +/* +This is setup as if/else due to the following GitHub issue: +"Legacy serialization infrastructure APIs marked obsolete" +https://github.com/dotnet/docs/issues/34893 + */ + +namespace JK.Common.Data.Sql.Tests.TestUtils; + +#if NET6_0_OR_GREATER + +internal static class GetUninitializedObjectHelper +{ + internal static T Instantiate() where T : class + => System.Runtime.CompilerServices.RuntimeHelpers.GetUninitializedObject(typeof(T)) as T; +} + +#else + +internal static class GetUninitializedObjectHelper +{ + internal static T Instantiate() where T : class + => System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(T)) as T; +} + +#endif diff --git a/src/JK.Common.Data.Sql/TestUtils/UnsafeSqlExceptionFactory.cs b/src/JK.Common.Data.Sql.Tests/TestUtils/UnsafeSqlExceptionFactory.cs similarity index 95% rename from src/JK.Common.Data.Sql/TestUtils/UnsafeSqlExceptionFactory.cs rename to src/JK.Common.Data.Sql.Tests/TestUtils/UnsafeSqlExceptionFactory.cs index c601d18..f689f37 100644 --- a/src/JK.Common.Data.Sql/TestUtils/UnsafeSqlExceptionFactory.cs +++ b/src/JK.Common.Data.Sql.Tests/TestUtils/UnsafeSqlExceptionFactory.cs @@ -2,7 +2,7 @@ using System; using System.Reflection; -using System.Runtime.Serialization; +using JK.Common.Data.Sql.Tests.TestUtils; using Microsoft.Data.SqlClient; namespace JK.Common.Data.Sql.TestUtils; @@ -64,7 +64,7 @@ private static SqlError MakeSqlError(int number, string message) /// WARNING: GetUninitializedObject doesn't call the constructor. /// private static T Instantiate() where T : class - => FormatterServices.GetUninitializedObject(typeof(T)) as T; + => GetUninitializedObjectHelper.Instantiate(); } #endif