Skip to content

Commit

Permalink
update to .net 8
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Nov 24, 2023
1 parent 051c039 commit 829c331
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 65 deletions.
3 changes: 2 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="AssemblyMetadata.Generators" Version="1.1.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/FluentCommand.Caching/FluentCommand.Caching.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MessagePack" Version="2.5.129" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
38 changes: 26 additions & 12 deletions src/FluentCommand.Generators/DataReaderFactoryWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,7 @@ public static string Generate(EntityClass entityClass)
codeBuilder
.AppendLine("/// <summary>")
.AppendLine("/// Extension methods for FluentCommand")
.AppendLine("/// </summary>");

codeBuilder
.Append("[global::System.CodeDom.Compiler.GeneratedCode(\"")
.Append("FluentCommand.Generators")
.Append("\", \"")
.Append("1.0.0.0")
.AppendLine("\")]");

codeBuilder
.AppendLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute]")
.AppendLine("[global::System.Diagnostics.DebuggerStepThroughAttribute]")
.AppendLine("/// </summary>")
.Append("public static partial class ")
.Append(entityClass.EntityName)
.AppendLine("DataReaderExtensions")
Expand Down Expand Up @@ -83,6 +72,11 @@ private static void WriteQuerySingleEntityTask(IndentedStringBuilder codeBuilder
.Append(entity.EntityName)
.AppendLine("\"/> if row exists; otherwise null.")
.AppendLine("/// </returns>")
.Append("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"")
.Append(ThisAssembly.Product)
.Append("\", \"")
.Append(ThisAssembly.InformationalVersion)
.AppendLine("\")]")
.Append("public static global::System.Threading.Tasks.Task<")
.Append(entity.EntityNamespace)
.Append(".")
Expand Down Expand Up @@ -140,6 +134,11 @@ private static void WriteQueryEntityTask(IndentedStringBuilder codeBuilder, Enti
.Append(entity.EntityName)
.AppendLine("\"/> objects.")
.AppendLine("/// </returns>")
.Append("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"")
.Append(ThisAssembly.Product)
.Append("\", \"")
.Append(ThisAssembly.InformationalVersion)
.AppendLine("\")]")
.Append("public static global::System.Threading.Tasks.Task<global::System.Collections.Generic.IEnumerable<")
.Append(entity.EntityNamespace)
.Append(".")
Expand Down Expand Up @@ -194,6 +193,11 @@ private static void WriteQuerySingleEntity(IndentedStringBuilder codeBuilder, En
.Append(entity.EntityName)
.AppendLine("\"/> if row exists; otherwise null.")
.AppendLine("/// </returns>")
.Append("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"")
.Append(ThisAssembly.Product)
.Append("\", \"")
.Append(ThisAssembly.InformationalVersion)
.AppendLine("\")]")
.Append("public static ")
.Append(entity.EntityNamespace)
.Append(".")
Expand Down Expand Up @@ -247,6 +251,11 @@ private static void WriteQueryEntity(IndentedStringBuilder codeBuilder, EntityCl
.Append(entity.EntityName)
.AppendLine("\"/> objects.")
.AppendLine("/// </returns>")
.Append("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"")
.Append(ThisAssembly.Product)
.Append("\", \"")
.Append(ThisAssembly.InformationalVersion)
.AppendLine("\")]")
.Append("public static global::System.Collections.Generic.IEnumerable<")
.Append(entity.EntityNamespace)
.Append(".")
Expand Down Expand Up @@ -298,6 +307,11 @@ private static void WriteEntityFactory(IndentedStringBuilder codeBuilder, Entity
.Append(entity.EntityName)
.AppendLine("\"/> having property names set that match the field names in the <paramref name=\"dataRecord\"/>.")
.AppendLine("/// </returns>")
.Append("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"")
.Append(ThisAssembly.Product)
.Append("\", \"")
.Append(ThisAssembly.InformationalVersion)
.AppendLine("\")]")
.Append("public static ")
.Append(entity.EntityNamespace)
.Append(".")
Expand Down
4 changes: 2 additions & 2 deletions src/FluentCommand.Json/FluentCommand.Json.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<RootNamespace>FluentCommand</RootNamespace>
</PropertyGroup>

Expand All @@ -9,7 +9,7 @@
</ItemGroup>

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

</Project>
2 changes: 1 addition & 1 deletion src/FluentCommand.SqlServer/FluentCommand.SqlServer.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<RootNamespace>FluentCommand</RootNamespace>
</PropertyGroup>

Expand Down
8 changes: 4 additions & 4 deletions src/FluentCommand/FluentCommand.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/FluentCommand.Entities/FluentCommand.Entities.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public async Task Generate()

await Verifier
.Verify(source)
.UseDirectory("Snapshots");
.UseDirectory("Snapshots")
.ScrubLinesContaining("GeneratedCodeAttribute");
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand All @@ -19,10 +19,10 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Verify.Xunit" Version="22.1.4" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Verify.Xunit" Version="22.5.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ namespace FluentCommand.Entities
/// <summary>
/// Extension methods for FluentCommand
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("FluentCommand.Generators", "1.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.Diagnostics.DebuggerStepThroughAttribute]
public static partial class StatusDataReaderExtensions
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsTestProject>false</IsTestProject>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.9" />
<PackageReference Include="Dapper" Version="2.1.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.13" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="Dapper" Version="2.1.24" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.14" />
</ItemGroup>

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

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -28,15 +28,15 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="dbup-postgresql" Version="5.0.37" />
<PackageReference Include="Npgsql" Version="7.0.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Testcontainers.Postgresql" Version="3.5.0" />
<PackageReference Include="XUnit.Hosting" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="Npgsql" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Testcontainers.Postgresql" Version="3.6.0" />
<PackageReference Include="XUnit.Hosting" Version="1.1.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
</ItemGroup>

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

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -28,14 +28,14 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="dbup-sqlite" Version="5.0.37" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.13" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="XUnit.Hosting" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="XUnit.Hosting" Version="1.1.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
</ItemGroup>

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

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down Expand Up @@ -31,17 +31,17 @@
</PackageReference>
<PackageReference Include="dbup-sqlserver" Version="5.0.37" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.2" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.13" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Testcontainers.MsSql" Version="3.5.0" />
<PackageReference Include="Testcontainers.Redis" Version="3.5.0" />
<PackageReference Include="XUnit.Hosting" Version="1.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Testcontainers.MsSql" Version="3.6.0" />
<PackageReference Include="Testcontainers.Redis" Version="3.6.0" />
<PackageReference Include="XUnit.Hosting" Version="1.1.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions test/FluentCommand.Tests/FluentCommand.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>
Expand All @@ -17,13 +17,13 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Verify.Xunit" Version="22.1.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Verify.Xunit" Version="22.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/FluentCommand.Tests/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public class User

[ConcurrencyCheck]
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
[DataFieldConverter<ConcurrencyTokenHandler>]
[DataFieldConverter(typeof(ConcurrencyTokenHandler))]
public ConcurrencyToken RowVersion { get; set; }
}

0 comments on commit 829c331

Please sign in to comment.