diff --git a/global.json b/global.json index 7da27634..d1c554a8 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "9.0.102", "rollForward": "latestMajor" } } \ No newline at end of file diff --git a/src/Dapper.AOT.Analyzers/CodeAnalysis/DapperInterceptorGenerator.cs b/src/Dapper.AOT.Analyzers/CodeAnalysis/DapperInterceptorGenerator.cs index 951a1060..47a2358b 100644 --- a/src/Dapper.AOT.Analyzers/CodeAnalysis/DapperInterceptorGenerator.cs +++ b/src/Dapper.AOT.Analyzers/CodeAnalysis/DapperInterceptorGenerator.cs @@ -212,9 +212,11 @@ static string BuildParameterMap(in ParseState ctx, IInvocationOperation op, stri internal static class FeatureKeys { - public const string InterceptorsPreviewNamespaces = nameof(InterceptorsPreviewNamespaces), + public const string InterceptorsNamespaces = nameof(InterceptorsNamespaces), + InterceptorsPreviewNamespaces = nameof(InterceptorsPreviewNamespaces), CodegenNamespace = "Dapper.AOT"; public static KeyValuePair InterceptorsPreviewNamespacePair => new(InterceptorsPreviewNamespaces, CodegenNamespace); + public static KeyValuePair InterceptorsNamespacePair => new(InterceptorsNamespaces, CodegenNamespace); } private static bool CheckPrerequisites(in GenerateState ctx) diff --git a/src/Dapper.AOT/CommandT.Batch.cs b/src/Dapper.AOT/CommandT.Batch.cs index 8c32d823..06e7b136 100644 --- a/src/Dapper.AOT/CommandT.Batch.cs +++ b/src/Dapper.AOT/CommandT.Batch.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.Data; using System.Data.Common; using System.Diagnostics; using System.Linq; @@ -222,6 +223,7 @@ private int ExecuteMultiBatch(ReadOnlySpan source, int batchSize) // TODO { Debug.Assert(source.Length > 1); UnifiedCommand batch = default; + bool closeConnection = false; try { foreach (var arg in source) @@ -231,6 +233,12 @@ private int ExecuteMultiBatch(ReadOnlySpan source, int batchSize) // TODO } if (!batch.HasBatch) return 0; + if (connection.State != ConnectionState.Open) + { + connection.Open(); + closeConnection = true; + } + var result = batch.AssertBatch.ExecuteNonQuery(); if (commandFactory.RequirePostProcess) @@ -241,9 +249,14 @@ private int ExecuteMultiBatch(ReadOnlySpan source, int batchSize) // TODO } finally { + if (closeConnection) + { + connection.Close(); + } batch.Cleanup(); } } + private int ExecuteMultiBatch(IEnumerable source, int batchSize) // TODO: sub-batching { if (commandFactory.RequirePostProcess) @@ -253,6 +266,7 @@ private int ExecuteMultiBatch(IEnumerable source, int batchSize) // TODO: } UnifiedCommand batch = default; + bool closeConnection = false; try { foreach (var arg in source) @@ -262,6 +276,12 @@ private int ExecuteMultiBatch(IEnumerable source, int batchSize) // TODO: } if (!batch.HasBatch) return 0; + if (connection.State != ConnectionState.Open) + { + connection.Open(); + closeConnection = true; + } + var result = batch.AssertBatch.ExecuteNonQuery(); if (commandFactory.RequirePostProcess) { @@ -271,6 +291,10 @@ private int ExecuteMultiBatch(IEnumerable source, int batchSize) // TODO: } finally { + if (closeConnection) + { + connection.Close(); + } batch.Cleanup(); } } diff --git a/src/Dapper.AOT/Internal/SyncCommandState.cs b/src/Dapper.AOT/Internal/SyncCommandState.cs index 85594995..90674cbb 100644 --- a/src/Dapper.AOT/Internal/SyncCommandState.cs +++ b/src/Dapper.AOT/Internal/SyncCommandState.cs @@ -38,7 +38,7 @@ private void OnBeforeExecute(DbCommand command) Debug.Assert(command?.Connection is not null); Command = command!; connection = command!.Connection; - + if (connection.State != ConnectionState.Open) { connection.Open(); diff --git a/src/Dapper.AOT/UnifiedCommand.cs b/src/Dapper.AOT/UnifiedCommand.cs index ad618a24..f7b69500 100644 --- a/src/Dapper.AOT/UnifiedCommand.cs +++ b/src/Dapper.AOT/UnifiedCommand.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Data; using System.Data.Common; +using System.Diagnostics.CodeAnalysis; +using System.Diagnostics; using System.Runtime.CompilerServices; namespace Dapper; @@ -16,8 +18,8 @@ namespace Dapper; #pragma warning restore IDE0079 public readonly struct UnifiedCommand - { + /// /// The associated with the current operation; this may be null for batch commands. /// diff --git a/test/Dapper.AOT.Test.Integration/Setup/IntegrationTestsBase.cs b/test/Dapper.AOT.Test.Integration/Setup/IntegrationTestsBase.cs index 3ea3ec41..806e6265 100644 --- a/test/Dapper.AOT.Test.Integration/Setup/IntegrationTestsBase.cs +++ b/test/Dapper.AOT.Test.Integration/Setup/IntegrationTestsBase.cs @@ -23,6 +23,7 @@ public abstract class IntegrationTestsBase .WithFeatures(new[] { new KeyValuePair("InterceptorsPreviewNamespaces", "$(InterceptorsPreviewNamespaces);Dapper.AOT"), + new KeyValuePair("InterceptorsNamespaces", "$(InterceptorsNamespaces);Dapper.AOT"), }); protected readonly IDbConnection DbConnection; diff --git a/test/Dapper.AOT.Test/Dapper.AOT.Test.csproj b/test/Dapper.AOT.Test/Dapper.AOT.Test.csproj index b01fbe51..bd4ee085 100644 --- a/test/Dapper.AOT.Test/Dapper.AOT.Test.csproj +++ b/test/Dapper.AOT.Test/Dapper.AOT.Test.csproj @@ -36,8 +36,6 @@ - - @@ -61,6 +59,8 @@ + + diff --git a/test/Dapper.AOT.Test/DapperApiTests.cs b/test/Dapper.AOT.Test/DapperApiTests.cs index 2e3d3bf1..a559c4aa 100644 --- a/test/Dapper.AOT.Test/DapperApiTests.cs +++ b/test/Dapper.AOT.Test/DapperApiTests.cs @@ -27,10 +27,10 @@ public void DiscoveredMethodsAreExpected() var names = string.Join(",", methods); Log.WriteLine(names); - Assert.Equal("AsList<,AsTableValuedParameter,AsTableValuedParameter<,Execute,ExecuteAsync,ExecuteReader,ExecuteReaderAsync,ExecuteScalar,ExecuteScalar<,ExecuteScalarAsync,ExecuteScalarAsync<,GetRowParser,GetRowParser<,GetTypeName,Parse,Parse<,Query,Query<,QueryAsync,QueryAsync<,QueryFirst,QueryFirst<,QueryFirstAsync,QueryFirstAsync<,QueryFirstOrDefault,QueryFirstOrDefault<,QueryFirstOrDefaultAsync,QueryFirstOrDefaultAsync<,QueryMultiple,QueryMultipleAsync,QuerySingle,QuerySingle<,QuerySingleAsync,QuerySingleAsync<,QuerySingleOrDefault,QuerySingleOrDefault<,QuerySingleOrDefaultAsync,QuerySingleOrDefaultAsync<" + (IsNetFx ? "" : ",QueryUnbufferedAsync,QueryUnbufferedAsync<") + ",ReplaceLiterals,SetTypeName", names); + Assert.Equal("AsList<,AsTableValuedParameter,AsTableValuedParameter<,Execute,ExecuteAsync,ExecuteReader,ExecuteReaderAsync,ExecuteScalar,ExecuteScalar<,ExecuteScalarAsync,ExecuteScalarAsync<,GetRowParser,GetRowParser<,GetTypeName,Parse,Parse<,Query,Query<,QueryAsync,QueryAsync<,QueryFirst,QueryFirst<,QueryFirstAsync,QueryFirstAsync<,QueryFirstOrDefault,QueryFirstOrDefault<,QueryFirstOrDefaultAsync,QueryFirstOrDefaultAsync<,QueryMultiple,QueryMultipleAsync,QuerySingle,QuerySingle<,QuerySingleAsync,QuerySingleAsync<,QuerySingleOrDefault,QuerySingleOrDefault<,QuerySingleOrDefaultAsync,QuerySingleOrDefaultAsync<,QueryUnbufferedAsync,QueryUnbufferedAsync<,ReplaceLiterals,SetTypeName", names); var candidates = string.Join(",", methods.Where(DapperInterceptorGenerator.IsCandidate)); Log.WriteLine(candidates); - Assert.Equal("Execute,ExecuteAsync,ExecuteReader,ExecuteReaderAsync,ExecuteScalar,ExecuteScalar<,ExecuteScalarAsync,ExecuteScalarAsync<,GetRowParser,GetRowParser<,Query,Query<,QueryAsync,QueryAsync<,QueryFirst,QueryFirst<,QueryFirstAsync,QueryFirstAsync<,QueryFirstOrDefault,QueryFirstOrDefault<,QueryFirstOrDefaultAsync,QueryFirstOrDefaultAsync<,QueryMultiple,QueryMultipleAsync,QuerySingle,QuerySingle<,QuerySingleAsync,QuerySingleAsync<,QuerySingleOrDefault,QuerySingleOrDefault<,QuerySingleOrDefaultAsync,QuerySingleOrDefaultAsync<" + (IsNetFx ? "" : ",QueryUnbufferedAsync,QueryUnbufferedAsync<"), candidates); + Assert.Equal("Execute,ExecuteAsync,ExecuteReader,ExecuteReaderAsync,ExecuteScalar,ExecuteScalar<,ExecuteScalarAsync,ExecuteScalarAsync<,GetRowParser,GetRowParser<,Query,Query<,QueryAsync,QueryAsync<,QueryFirst,QueryFirst<,QueryFirstAsync,QueryFirstAsync<,QueryFirstOrDefault,QueryFirstOrDefault<,QueryFirstOrDefaultAsync,QueryFirstOrDefaultAsync<,QueryMultiple,QueryMultipleAsync,QuerySingle,QuerySingle<,QuerySingleAsync,QuerySingleAsync<,QuerySingleOrDefault,QuerySingleOrDefault<,QuerySingleOrDefaultAsync,QuerySingleOrDefaultAsync<,QueryUnbufferedAsync,QueryUnbufferedAsync<", candidates); } } diff --git a/test/Dapper.AOT.Test/Helpers/TestFramework.cs b/test/Dapper.AOT.Test/Helpers/TestFramework.cs index 323e65d6..ff4fe80e 100644 --- a/test/Dapper.AOT.Test/Helpers/TestFramework.cs +++ b/test/Dapper.AOT.Test/Helpers/TestFramework.cs @@ -13,11 +13,15 @@ internal static class TestFramework Enum.GetValues() #endif .Select(static x => x.ToString()) - .ToHashSet(); + .ToHashSet(StringComparer.OrdinalIgnoreCase); public static Net DetermineNetVersion() { -#if NET6_0_OR_GREATER +#if NET9_0_OR_GREATER + return Net.Net9; +#elif NET8_0_OR_GREATER + return Net.Net8; +#elif NET6_0_OR_GREATER return Net.Net6; #else return Net.Net48; @@ -27,7 +31,9 @@ public static Net DetermineNetVersion() public enum Net { Net48, - Net6 + Net6, + Net8, + Net9, } } } diff --git a/test/Dapper.AOT.Test/InterceptorTests.cs b/test/Dapper.AOT.Test/InterceptorTests.cs index 2f863dad..9410ed24 100644 --- a/test/Dapper.AOT.Test/InterceptorTests.cs +++ b/test/Dapper.AOT.Test/InterceptorTests.cs @@ -28,7 +28,11 @@ public static IEnumerable GetFiles() if (TestFramework.NetVersions.Contains(fileNetVersionStr)) { // it has to be the same or greater version - var fileNetVersion = (TestFramework.Net)Enum.Parse(typeof(TestFramework.Net), fileNetVersionStr); +#if NET48 + var fileNetVersion = (TestFramework.Net)Enum.Parse(typeof(TestFramework.Net), fileNetVersionStr, true); +#else + var fileNetVersion = Enum.Parse(fileNetVersionStr, true); +#endif if (currentNetVersion < fileNetVersion) { // skip if current version is lower than specified in the input file name diff --git a/test/Dapper.AOT.Test/TSqlParserTests.cs b/test/Dapper.AOT.Test/TSqlParserTests.cs index 0cb5c82d..a5c3c255 100644 --- a/test/Dapper.AOT.Test/TSqlParserTests.cs +++ b/test/Dapper.AOT.Test/TSqlParserTests.cs @@ -306,7 +306,7 @@ from Customers var args = parser.GetParameters(out var errors); Assert.Equal("@id", Assert.Single(args)); - Assert.Equal("Incorrect syntax near garbage. (#46010) L5 C27", Assert.Single(errors)); + Assert.Equal("Incorrect syntax near 'garbage'. (#46010) L5 C27", Assert.Single(errors)); } [Fact] diff --git a/test/Dapper.AOT.Test/TestCommon/RoslynTestHelpers.cs b/test/Dapper.AOT.Test/TestCommon/RoslynTestHelpers.cs index 9b6cdfa9..6555826a 100644 --- a/test/Dapper.AOT.Test/TestCommon/RoslynTestHelpers.cs +++ b/test/Dapper.AOT.Test/TestCommon/RoslynTestHelpers.cs @@ -43,7 +43,9 @@ internal static class RoslynTestHelpers "RELEASE", #endif }) - .WithFeatures([DapperInterceptorGenerator.FeatureKeys.InterceptorsPreviewNamespacePair]); + .WithFeatures([ + DapperInterceptorGenerator.FeatureKeys.InterceptorsPreviewNamespacePair, + DapperInterceptorGenerator.FeatureKeys.InterceptorsNamespacePair]); public static Compilation CreateCompilation(string source, string name, string fileName) => CSharpCompilation.Create(name, diff --git a/test/Dapper.AOT.Test/Verifiers/DAP206.cs b/test/Dapper.AOT.Test/Verifiers/DAP206.cs index b34dd7c6..83455845 100644 --- a/test/Dapper.AOT.Test/Verifiers/DAP206.cs +++ b/test/Dapper.AOT.Test/Verifiers/DAP206.cs @@ -13,5 +13,5 @@ public class DAP206 : Verifier [Fact] public Task ParseError() => SqlVerifyAsync("{|#0:|}111 invalid", Diagnostic(Diagnostics.ParseError) - .WithLocation(0).WithArguments(46010, "Incorrect syntax near 111.")); + .WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'.")); } \ No newline at end of file diff --git a/test/Dapper.AOT.Test/Verifiers/SqlDetection.cs b/test/Dapper.AOT.Test/Verifiers/SqlDetection.cs index 27667381..d6140880 100644 --- a/test/Dapper.AOT.Test/Verifiers/SqlDetection.cs +++ b/test/Dapper.AOT.Test/Verifiers/SqlDetection.cs @@ -21,7 +21,7 @@ public void Foo(DbConnection conn) } } """, DefaultConfig, [Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(0).WithArguments(46010, "Incorrect syntax near 111.")]); + .WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'.")]); [Fact] public Task CSVerifyQuestionMarkInQuery_LikePseudoPositional() => CSVerifyAsync(""" @@ -79,9 +79,9 @@ public void Foo(DbCommand cmd) public string Blap {get;set;} } """, DefaultConfig, [Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(0).WithArguments(46010, "Incorrect syntax near 111."), + .WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(1).WithArguments(46010, "Incorrect syntax near 444.")]); + .WithLocation(1).WithArguments(46010, "Incorrect syntax near '444'.")]); [Fact] public Task CSViaParam() => CSVerifyAsync(""" @@ -104,10 +104,10 @@ public void Usage() """, DefaultConfig, [Diagnostic(DapperAnalyzer.Diagnostics.ParseError) .WithLocation(0) - .WithArguments(46010, "Incorrect syntax near 111."), + .WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) .WithLocation(1) - .WithArguments(46010, "Incorrect syntax near 333.")]); + .WithArguments(46010, "Incorrect syntax near '333'.")]); [Fact] public Task VBViaDapper() => VBVerifyAsync(""" @@ -122,7 +122,7 @@ Public Sub Foo(conn As DbConnection) End Sub End Class """, DefaultConfig, [Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(0).WithArguments(46010, "Incorrect syntax near 111.")]); + .WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'.")]); [Fact] public Task VBViaProperty() => VBVerifyAsync(""" @@ -145,9 +145,9 @@ Public Property Bar As String Public Property Blap As String End Class """, DefaultConfig, [Diagnostic(DapperAnalyzer.Diagnostics.ParseError) -.WithLocation(0).WithArguments(46010, "Incorrect syntax near 111."), +.WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) -.WithLocation(1).WithArguments(46010, "Incorrect syntax near 444.")]); +.WithLocation(1).WithArguments(46010, "Incorrect syntax near '444'.")]); [Fact] public Task VBViaParam() => VBVerifyAsync(""" @@ -171,10 +171,10 @@ End Class """, DefaultConfig, [Diagnostic(DapperAnalyzer.Diagnostics.ParseError) .WithLocation(0) - .WithArguments(46010, "Incorrect syntax near 111."), + .WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) .WithLocation(1) - .WithArguments(46010, "Incorrect syntax near 333.")]); + .WithArguments(46010, "Incorrect syntax near '333'.")]); [Fact] public Task CSharpSmokeTestVanilla() => CSVerifyAsync("""" diff --git a/test/Dapper.AOT.Test/Verifiers/SqlSyntaxDetection.cs b/test/Dapper.AOT.Test/Verifiers/SqlSyntaxDetection.cs index 5685c70c..740c0fcc 100644 --- a/test/Dapper.AOT.Test/Verifiers/SqlSyntaxDetection.cs +++ b/test/Dapper.AOT.Test/Verifiers/SqlSyntaxDetection.cs @@ -28,11 +28,11 @@ public void Foo(Microsoft.Data.SqlClient.SqlConnection conn) } """, DefaultConfig, [ Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(0).WithArguments(46010, "Incorrect syntax near 111."), + .WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(1).WithArguments(46010, "Incorrect syntax near 222."), + .WithLocation(1).WithArguments(46010, "Incorrect syntax near '222'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(2).WithArguments(46010, "Incorrect syntax near 333."), + .WithLocation(2).WithArguments(46010, "Incorrect syntax near '333'."), ], SqlSyntax.SqlServer); [Fact] @@ -57,9 +57,9 @@ public void Foo(Microsoft.Data.SqlClient.SqlConnection conn) // still picked up } """, DefaultConfig, [ Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(1).WithArguments(46010, "Incorrect syntax near 222."), + .WithLocation(1).WithArguments(46010, "Incorrect syntax near '222'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(2).WithArguments(46010, "Incorrect syntax near 333."), + .WithLocation(2).WithArguments(46010, "Incorrect syntax near '333'."), ], SqlSyntax.General); [Fact] @@ -87,11 +87,11 @@ public void Foo(Microsoft.Data.SqlClient.SqlConnection conn) } """, DefaultConfig, [ Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(0).WithArguments(46010, "Incorrect syntax near 111."), + .WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(1).WithArguments(46010, "Incorrect syntax near 222."), + .WithLocation(1).WithArguments(46010, "Incorrect syntax near '222'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(2).WithArguments(46010, "Incorrect syntax near 333."), + .WithLocation(2).WithArguments(46010, "Incorrect syntax near '333'."), ], SqlSyntax.General); [Fact] @@ -116,11 +116,11 @@ public void Foo(Microsoft.Data.SqlClient.SqlConnection conn) } """, DefaultConfig, [ Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(0).WithArguments(46010, "Incorrect syntax near 111."), + .WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(1).WithArguments(46010, "Incorrect syntax near 222."), + .WithLocation(1).WithArguments(46010, "Incorrect syntax near '222'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(2).WithArguments(46010, "Incorrect syntax near 333."), + .WithLocation(2).WithArguments(46010, "Incorrect syntax near '333'."), ], SqlSyntax.General); [Fact] @@ -148,11 +148,11 @@ public void Foo(Microsoft.Data.SqlClient.SqlConnection conn) } """, DefaultConfig, [ Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(0).WithArguments(46010, "Incorrect syntax near 111."), + .WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(1).WithArguments(46010, "Incorrect syntax near 222."), + .WithLocation(1).WithArguments(46010, "Incorrect syntax near '222'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(2).WithArguments(46010, "Incorrect syntax near 333."), + .WithLocation(2).WithArguments(46010, "Incorrect syntax near '333'."), ], SqlSyntax.General); [Fact] @@ -177,11 +177,11 @@ public void Foo(Microsoft.Data.SqlClient.SqlConnection conn) } """, DefaultConfig, [ Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(0).WithArguments(46010, "Incorrect syntax near 111."), + .WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(1).WithArguments(46010, "Incorrect syntax near 222."), + .WithLocation(1).WithArguments(46010, "Incorrect syntax near '222'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) - .WithLocation(2).WithArguments(46010, "Incorrect syntax near 333."), + .WithLocation(2).WithArguments(46010, "Incorrect syntax near '333'."), ], SqlSyntax.General); [Fact] @@ -206,11 +206,11 @@ public void Foo(Microsoft.Data.SqlClient.SqlConnection conn) } """, DefaultConfig, [ Diagnostic(DapperAnalyzer.Diagnostics.ParseError) -.WithLocation(0).WithArguments(46010, "Incorrect syntax near 111."), +.WithLocation(0).WithArguments(46010, "Incorrect syntax near '111'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) -.WithLocation(1).WithArguments(46010, "Incorrect syntax near 222."), +.WithLocation(1).WithArguments(46010, "Incorrect syntax near '222'."), Diagnostic(DapperAnalyzer.Diagnostics.ParseError) -.WithLocation(2).WithArguments(46010, "Incorrect syntax near 333."), +.WithLocation(2).WithArguments(46010, "Incorrect syntax near '333'."), ], SqlSyntax.General); diff --git a/test/Dapper.AOT.Test/Verifiers/Verifier.cs b/test/Dapper.AOT.Test/Verifiers/Verifier.cs index 406d92b1..4dd38d1b 100644 --- a/test/Dapper.AOT.Test/Verifiers/Verifier.cs +++ b/test/Dapper.AOT.Test/Verifiers/Verifier.cs @@ -125,7 +125,8 @@ static SourceText CreateEditorConfig(SqlSyntax syntax, SqlParseInputFlags sqlPar private static readonly SourceText AssumeSqlServer = CreateEditorConfig(SqlSyntax.SqlServer, SqlParseInputFlags.None); protected static readonly Func InterceptorsEnabled = WithFeatures( - DapperInterceptorGenerator.FeatureKeys.InterceptorsPreviewNamespacePair + DapperInterceptorGenerator.FeatureKeys.InterceptorsPreviewNamespacePair, + DapperInterceptorGenerator.FeatureKeys.InterceptorsNamespacePair ); protected static readonly Func CSharpPreview = WithCSharpLanguageVersion(Microsoft.CodeAnalysis.CSharp.LanguageVersion.Preview); diff --git a/test/UsageBenchmark/UsageBenchmark.csproj b/test/UsageBenchmark/UsageBenchmark.csproj index b3eff8e1..02add5ad 100644 --- a/test/UsageBenchmark/UsageBenchmark.csproj +++ b/test/UsageBenchmark/UsageBenchmark.csproj @@ -4,6 +4,7 @@ net8.0 False $(InterceptorsPreviewNamespaces);Dapper.AOT + $(InterceptorsNamespaces);Dapper.AOT