Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more dotnet8 #105

Merged
merged 6 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions src/JK.Common.Data.Sql.Tests/JK.Common.Data.Sql.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>11.0</LangVersion>
<TargetFrameworks>net48;net6.0;net7.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>
<TargetFrameworks>net48;net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -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<T>() where T : class
=> System.Runtime.CompilerServices.RuntimeHelpers.GetUninitializedObject(typeof(T)) as T;
}

#else

internal static class GetUninitializedObjectHelper
{
internal static T Instantiate<T>() where T : class
=> System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(T)) as T;
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -64,7 +64,7 @@ private static SqlError MakeSqlError(int number, string message)
/// WARNING: GetUninitializedObject doesn't call the constructor.
/// </summary>
private static T Instantiate<T>() where T : class
=> FormatterServices.GetUninitializedObject(typeof(T)) as T;
=> GetUninitializedObjectHelper.Instantiate<T>();
}

#endif
10 changes: 10 additions & 0 deletions src/JK.Common.Data.Sql/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 21 additions & 21 deletions src/JK.Common.Data.Sql/JK.Common.Data.Sql.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>11.0</LangVersion>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<Authors>Jeremy Knight</Authors>
<Version>5.1.0</Version>
<Copyright>Copyright Jeremy Knight. All rights reserved.</Copyright>
<Description>A utility library containing extensions to System.Data.SqlClient</Description>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://github.com/jeremyknight-me/JK.Common</PackageProjectUrl>
<RepositoryUrl>https://github.com/jeremyknight-me/JK.Common</RepositoryUrl>
</PropertyGroup>
<PropertyGroup>
<LangVersion>12.0</LangVersion>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Authors>Jeremy Knight</Authors>
<Version>5.2.0</Version>
<Copyright>Copyright Jeremy Knight. All rights reserved.</Copyright>
<Description>A utility library containing extensions to System.Data.SqlClient</Description>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://github.com/jeremyknight-me/JK.Common</PackageProjectUrl>
<RepositoryUrl>https://github.com/jeremyknight-me/JK.Common</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JK.Common.Abstractions" Version="1.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="JK.Common.Abstractions" Version="1.1.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions src/JK.Common.EntityFrameworkCore.SqlServer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace JK.Common.EntityFrameworkCore.SqlServer.Extensions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace JK.Common.EntityFrameworkCore.SqlServer.Extensions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>10.0</LangVersion>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Version>3.1.0</Version>
<Version>3.2.0</Version>
<Authors>Jeremy Knight</Authors>
<Company>Jeremy Knight</Company>
<Description>A utility library containing extensions to Microsoft.EntityFrameworkCore.SqlServer</Description>
Expand All @@ -15,20 +15,16 @@
<RepositoryUrl>https://github.com/jeremyknight-me/JK.Common</RepositoryUrl>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.4" />
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.12" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.12" />
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.15" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.24" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.32" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>10.0</LangVersion>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -19,14 +19,14 @@
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.8" />
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.8" />
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.15" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/JK.Common.EntityFrameworkCore.Tests/Usings.cs
Original file line number Diff line number Diff line change
@@ -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;
6 changes: 6 additions & 0 deletions src/JK.Common.EntityFrameworkCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Microsoft.EntityFrameworkCore;
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using System;

namespace JK.Common.EntityFrameworkCore;

public static class ChangeTrackerExtensions

Check warning on line 7 in src/JK.Common.EntityFrameworkCore/ChangeTrackerExtensions.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ChangeTrackerExtensions'
{
public static int EnsureAuditableEntitiesUpdated(this ChangeTracker changeTracker)

Check warning on line 9 in src/JK.Common.EntityFrameworkCore/ChangeTrackerExtensions.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ChangeTrackerExtensions.EnsureAuditableEntitiesUpdated(ChangeTracker)'
{
var count = 0;
foreach (var change in changeTracker.Entries())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>10.0</LangVersion>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Description>A utility library containing extensions to Microsoft.EntityFrameworkCore</Description>
<PackageProjectUrl>https://github.com/jeremyknight-me/JK.Common</PackageProjectUrl>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<Version>4.0.0</Version>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<Version>4.1.0</Version>
<Authors>Jeremy Knight</Authors>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Copyright>Copyright Jeremy Knight. All rights reserved.</Copyright>
<RepositoryUrl>https://github.com/jeremyknight-me/JK.Common</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="7.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.11" />
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.11" />
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.15" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
Expand Down
4 changes: 2 additions & 2 deletions src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using Microsoft.EntityFrameworkCore;
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace JK.Common.EntityFrameworkCore;

public abstract class ReadOnlyDbContext : DbContext

Check warning on line 8 in src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ReadOnlyDbContext'
{
private const string readOnlyErrorMessage = "This context is read-only.";

protected ReadOnlyDbContext()

Check warning on line 12 in src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ReadOnlyDbContext.ReadOnlyDbContext()'
{
this.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
}

protected ReadOnlyDbContext(DbContextOptions options)

Check warning on line 17 in src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ReadOnlyDbContext.ReadOnlyDbContext(DbContextOptions)'
: base(options)
{
this.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
Expand All @@ -22,10 +22,10 @@

#region SaveChanges overrides - ensures read-only

public override int SaveChanges()

Check warning on line 25 in src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ReadOnlyDbContext.SaveChanges()'
=> throw new InvalidOperationException(readOnlyErrorMessage);

public override int SaveChanges(bool acceptAllChangesOnSuccess)

Check warning on line 28 in src/JK.Common.EntityFrameworkCore/ReadOnlyDbContext.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ReadOnlyDbContext.SaveChanges(bool)'
=> throw new InvalidOperationException(readOnlyErrorMessage);

public override Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
12 changes: 9 additions & 3 deletions src/JK.Common.FluentValidation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading