Skip to content

Commit 810789e

Browse files
committed
lib refresh and fixup
1 parent 25203a3 commit 810789e

20 files changed

+394
-53
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ dotnet_diagnostic.RS2008.severity = none
55

66
# IDE0290: Use primary constructor
77
dotnet_diagnostic.IDE0290.severity = none
8+
9+
# CA1860: Avoid IEnumerable<T>.Count()
10+
dotnet_diagnostic.CA1860.severity = none

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<LangVersion>preview</LangVersion>
2828
<Features>($Features);strict</Features>
2929
<EnableNETAnalyzers>true</EnableNETAnalyzers>
30+
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
3031
</PropertyGroup>
3132
<ItemGroup>
3233
<None Include="$(MSBuildThisFileDirectory)Dapper.png" Visible="false">

Directory.Packages.props

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
<Project>
22
<!--<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Packages.props, $(MSBuildThisFileDirectory)..))" />..-->
33
<ItemGroup>
4-
<PackageVersion Include="BenchmarkDotNet" Version="0.13.10" />
4+
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
55
<PackageVersion Include="FastMember" Version="1.5.0" />
6-
<PackageVersion Include="Dapper" Version="2.1.21" />
7-
<PackageVersion Include="Dapper.AOT" Version="1.0.14" />
8-
<PackageVersion Include="Dapper.StrongName" Version="2.1.21" />
9-
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.133" />
10-
<PackageVersion Include="Npgsql" Version="7.0.6" />
11-
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
12-
<PackageVersion Include="Microsoft.Build" Version="17.7.2" />
13-
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.7.2" />
6+
<PackageVersion Include="Dapper" Version="2.1.66" />
7+
<PackageVersion Include="Dapper.AOT" Version="1.0.31" />
8+
<PackageVersion Include="Dapper.StrongName" Version="2.1.66" />
9+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.7.115" />
10+
<PackageVersion Include="Npgsql" Version="9.0.2" />
11+
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.1" />
12+
<PackageVersion Include="Microsoft.Build" Version="17.12.6" />
13+
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
1414
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.1" />
1515
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.1" />
16-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
16+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
1717
<!-- 4.8 would be nice, but: let's try to offer down-level compiler support -->
1818
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="[4.4.0]" />
1919
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Analyzer.Testing.XUnit" Version="1.1.1" />
2020
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.CodeFix.Testing.XUnit" Version="1.1.1" />
2121
<!-- 4.8 would be nice, but: let's try to offer down-level compiler support -->
2222
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="[4.4.0]" />
23-
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.2" />
24-
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
25-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
26-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
27-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
28-
<PackageVersion Include="Microsoft.SqlServer.TransactSql.ScriptDom" Version="161.8910.0" />
29-
<PackageVersion Include="Oracle.ManagedDataAccess" Version="21.12.0" />
30-
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="3.21.120" />
31-
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
23+
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.0.1" />
24+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
25+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.1" />
26+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
27+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
28+
<PackageVersion Include="Microsoft.SqlServer.TransactSql.ScriptDom" Version="170.23.0" />
29+
<PackageVersion Include="Oracle.ManagedDataAccess" Version="23.7.0" />
30+
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="23.7.0" />
31+
<PackageVersion Include="System.Collections.Immutable" Version="9.0.1" />
3232
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
3333
<PackageVersion Include="System.Data.Common" Version="4.3.0" />
34-
<PackageVersion Include="System.Data.SqlClient" Version="4.8.5" />
35-
<PackageVersion Include="System.Memory" Version="4.5.5" />
36-
<PackageVersion Include="Testcontainers.MsSql" Version="3.10.0" />
37-
<PackageVersion Include="Testcontainers.PostgreSql" Version="3.6.0" />
34+
<PackageVersion Include="System.Data.SqlClient" Version="4.9.0" />
35+
<PackageVersion Include="System.Memory" Version="4.6.0" />
36+
<PackageVersion Include="Testcontainers.MsSql" Version="4.1.0" />
37+
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.1.0" />
3838
<!-- these are bound by Microsoft.CodeAnalysis.CSharp.*.Testing.XUnit -->
3939
<PackageVersion Include="xunit" Version="[2.3.0]" />
4040
<PackageVersion Include="xunit.runner.visualstudio" Version="[2.3.0]" />

test/Dapper.AOT.Test.Integration.Executables/Dapper.AOT.Test.Integration.Executables.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
<PropertyGroup>
33
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
44
<RootNamespace>Dapper.AOT.Test.Integration.Executables</RootNamespace>
5+
<NoWarn>$(NoWarn);CS8002</NoWarn>
56
</PropertyGroup>
67

78
<ItemGroup>
9+
<PackageReference Include="Dapper" Condition="'$(TargetFramework)' == 'net8.0'" />
810
<PackageReference Include="Dapper" Condition="'$(TargetFramework)' == 'net6.0'" />
911
<PackageReference Include="Dapper.StrongName" Condition="'$(TargetFramework)'=='net48'" />
10-
<PackageReference Include="Dapper" Condition="'$(TargetFramework)' == 'net8.0'" />
1112

1213
<ProjectReference Include="..\..\src\Dapper.AOT.Analyzers\Dapper.AOT.Analyzers.csproj" />
1314
<ProjectReference Include="..\..\src\Dapper.AOT\Dapper.AOT.csproj" />

test/Dapper.AOT.Test.Integration/Dapper.AOT.Test.Integration.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
88
<IsTestProject>true</IsTestProject>
9+
<NoWarn>$(NoWarn);CS8002</NoWarn>
910
</PropertyGroup>
1011

1112
<ItemGroup>

test/Dapper.AOT.Test/Dapper.AOT.Test.csproj

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0;net48</TargetFrameworks>
3+
<TargetFrameworks>net8.0;net48;net9.0</TargetFrameworks>
44
<NoWarn>$(NoWarn);IDE0042;CS8002;CA1816</NoWarn>
55
<RootNamespace>Dapper.AOT.Test</RootNamespace>
66
<DefineConstants>$(DefineConstants);DAPPERAOT_INTERNAL</DefineConstants>
@@ -23,19 +23,17 @@
2323
<None Update="**/*.output.netfx.*">
2424
<DependentUpon>$([System.String]::Copy(%(Filename)).Replace('.output.netfx', '.input.cs'))</DependentUpon>
2525
</None>
26-
<None Update="**/*DAP*.*.cs*">
27-
<DependentUpon>$([System.String]::Copy(%(Filename)).Replace('.VB.cs', '.cs'))</DependentUpon>
28-
</None>
26+
<None Update="**/*DAP*.*.cs*">
27+
<DependentUpon>$([System.String]::Copy(%(Filename)).Replace('.VB.cs', '.cs'))</DependentUpon>
28+
</None>
2929

30-
</ItemGroup>
30+
</ItemGroup>
3131
<ItemGroup>
3232
<PackageReference Include="Dapper" Condition="'$(TargetFramework)'!='net48'" />
3333
<PackageReference Include="Dapper.StrongName" Condition="'$(TargetFramework)'=='net48'" />
34-
<PackageReference Include="System.ComponentModel.Annotations" Condition="'$(TargetFramework)'=='net48'" />
35-
<PackageReference Include="Microsoft.Build" Condition="'$(TargetFramework)'!='net6.0'" />
36-
<PackageReference Include="Microsoft.Build" VersionOverride="17.10.4" Condition="'$(TargetFramework)'=='net6.0'" />
34+
<PackageReference Include="Microsoft.Build" Condition="'$(TargetFramework)'!='net8.0'" />
35+
<PackageReference Include="Microsoft.Build" VersionOverride="17.11.4" Condition="'$(TargetFramework)'=='net8.0'" />
3736
<PackageReference Include="Microsoft.Build.Utilities.Core" />
38-
<PackageReference Include="Npgsql" />
3937
<PackageReference Include="Oracle.ManagedDataAccess" Condition="'$(TargetFramework)'=='net48'" />
4038
<PackageReference Include="Oracle.ManagedDataAccess.Core" Condition="'$(TargetFramework)'!='net48'" />
4139
<PackageReference Include="System.ComponentModel.Annotations" />
@@ -48,17 +46,23 @@
4846
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4947
</PackageReference>
5048
<PackageReference Include="Microsoft.NET.Test.Sdk" />
51-
5249
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
5350
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" />
5451
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" />
5552
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" />
5653
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Analyzer.Testing.XUnit" />
5754
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.CodeFix.Testing.XUnit" />
5855
<PackageReference Include="Testcontainers.PostgreSql" />
59-
<PackageReference Include="Testcontainers.MsSql" />
56+
<PackageReference Include="Testcontainers.MsSql" />
6057
</ItemGroup>
61-
58+
59+
<ItemGroup Condition="'$(TargetFramework)'!='net48'">
60+
<PackageReference Include="Npgsql" />
61+
</ItemGroup>
62+
<ItemGroup Condition="'$(TargetFramework)'=='net48'">
63+
<PackageReference Include="Npgsql" VersionOverride="8.0.6" />
64+
</ItemGroup>
65+
6266
<ItemGroup>
6367
<ProjectReference Include="../../src/Dapper.AOT.Analyzers/Dapper.AOT.Analyzers.csproj" />
6468
<ProjectReference Include="../../src/Dapper.AOT/Dapper.AOT.csproj" />

test/Dapper.AOT.Test/GeneratorTestBase.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Dapper.TestCommon;
1+
using Dapper.AOT.Test.TestCommon;
22
using Microsoft.CodeAnalysis;
33
using Microsoft.CodeAnalysis.CSharp;
44
using System;
@@ -67,7 +67,7 @@ void Output(string message, bool force = false)
6767
ShowDiagnostics("Input code", inputCompilation, diagnosticsTo, "CS8795", "CS1701", "CS1702");
6868

6969
// Create the driver that will control the generation, passing in our generator
70-
GeneratorDriver driver = CSharpGeneratorDriver.Create(new[] { generator.AsSourceGenerator() }, parseOptions: RoslynTestHelpers.ParseOptionsLatestLangVer);
70+
GeneratorDriver driver = CSharpGeneratorDriver.Create([generator.AsSourceGenerator()], parseOptions: RoslynTestHelpers.ParseOptionsLatestLangVer);
7171

7272
// Run the generation pass
7373
// (Note: the generator driver itself is immutable, and all calls return an updated version of the driver that you should use for subsequent calls)
@@ -79,7 +79,7 @@ void Output(string message, bool force = false)
7979
if (result.Exception is not null) throw result.Exception;
8080
}
8181

82-
var dn = Normalize(diagnostics, Array.Empty<string>());
82+
var dn = Normalize(diagnostics, []);
8383
if (dn.Any())
8484
{
8585
Output($"Generator produced {dn.Count} diagnostics:");
@@ -131,11 +131,11 @@ void OutputDiagnostic(Diagnostic d)
131131
}
132132
}
133133

134-
static List<Diagnostic> Normalize(ImmutableArray<Diagnostic> diagnostics, string[] ignore) => (
134+
static List<Diagnostic> Normalize(ImmutableArray<Diagnostic> diagnostics, string[] ignore) => [..
135135
from d in diagnostics
136136
where !ignore.Contains(d.Id)
137137
let loc = d.Location
138138
orderby loc.SourceTree?.FilePath, loc.SourceSpan.Start, d.Id, d.ToString()
139-
select d).ToList();
139+
select d];
140140
}
141141
}

test/Dapper.AOT.Test/Helpers/TestFramework.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ namespace Dapper.AOT.Test.Helpers
66
{
77
internal static class TestFramework
88
{
9-
public static readonly ISet<string> NetVersions
10-
= ((Net[])Enum.GetValues(typeof(Net)))
9+
public static readonly ISet<string> NetVersions =
10+
#if NET48
11+
((Net[])Enum.GetValues(typeof(Net)))
12+
#else
13+
Enum.GetValues<Net>()
14+
#endif
1115
.Select(static x => x.ToString())
1216
.ToHashSet();
1317

1418
public static Net DetermineNetVersion()
1519
{
1620
#if NET6_0_OR_GREATER
1721
return Net.Net6;
18-
#endif
22+
#else
1923
return Net.Net48;
24+
#endif
2025
}
2126

2227
public enum Net

test/Dapper.AOT.Test/InGeneration/DbStringHelpersTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Data;
22
using System.Data.Common;
3-
using System.Data.SqlClient;
3+
using Microsoft.Data.SqlClient;
44
using Xunit;
55

66
namespace Dapper.AOT.Test.InGeneration
@@ -30,6 +30,6 @@ public void ConfigureDbString_ShouldProperlySetupDbParameter(bool isAnsi, bool i
3030
Assert.Equal(expectedDbType, param.DbType);
3131
}
3232

33-
DbParameter CreateDbParameter() => new SqlParameter();
33+
private static SqlParameter CreateDbParameter() => new();
3434
}
3535
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1+
Input code has 1 diagnostics from 'Interceptors/Blame.input.cs':
2+
3+
Warning CS0618 Interceptors/Blame.input.cs L8 C28
4+
'SqlConnection' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.'
15
Generator produced 1 diagnostics:
26

37
Hidden DAP000 L1 C1
48
Dapper.AOT handled 23 of 23 possible call-sites using 1 interceptors, 0 commands and 0 readers
9+
Output code has 1 diagnostics from 'Interceptors/Blame.input.cs':
10+
11+
Warning CS0618 Interceptors/Blame.input.cs L8 C28
12+
'SqlConnection' is obsolete: 'Use the Microsoft.Data.SqlClient package instead.'

0 commit comments

Comments
 (0)