diff --git a/src/Dapper.AOT.Analyzers/InGeneration/DapperHelpers.cs b/src/Dapper.AOT.Analyzers/InGeneration/DapperHelpers.cs
index 217d9da8..dbc9e5c0 100644
--- a/src/Dapper.AOT.Analyzers/InGeneration/DapperHelpers.cs
+++ b/src/Dapper.AOT.Analyzers/InGeneration/DapperHelpers.cs
@@ -6,7 +6,7 @@
#if !DAPPERAOT_INTERNAL
file
#endif
- static class DbStringHelpers
+ static partial class DbStringHelpers
{
public static void ConfigureDbStringDbParameter(
global::System.Data.Common.DbParameter dbParameter,
diff --git a/test/Dapper.AOT.Test.Integration/Dapper.AOT.Test.Integration.csproj b/test/Dapper.AOT.Test.Integration/Dapper.AOT.Test.Integration.csproj
index 755afdfa..d1013c01 100644
--- a/test/Dapper.AOT.Test.Integration/Dapper.AOT.Test.Integration.csproj
+++ b/test/Dapper.AOT.Test.Integration/Dapper.AOT.Test.Integration.csproj
@@ -7,16 +7,17 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -49,6 +50,7 @@
+
diff --git a/test/Dapper.AOT.Test.Integration/DbStringTests.cs b/test/Dapper.AOT.Test.Integration/DbStringTests.cs
index 0e185aa0..829782e5 100644
--- a/test/Dapper.AOT.Test.Integration/DbStringTests.cs
+++ b/test/Dapper.AOT.Test.Integration/DbStringTests.cs
@@ -1,30 +1,32 @@
-using System.Linq;
+using System.Data;
+using System.Threading.Tasks;
using Dapper.AOT.Test.Integration.Setup;
using Xunit;
+using Xunit.Abstractions;
namespace Dapper.AOT.Test.Integration;
[Collection(SharedPostgresqlClient.Collection)]
-public class DbStringTests
+public class DbStringTests : InterceptedCodeExecutionTestsBase
{
- private PostgresqlFixture _fixture;
-
- public DbStringTests(PostgresqlFixture fixture)
+ public DbStringTests(PostgresqlFixture fixture, ITestOutputHelper log) : base(fixture, log)
{
- _fixture = fixture;
- fixture.NpgsqlConnection.Execute("""
+ Fixture.NpgsqlConnection.Execute("""
CREATE TABLE IF NOT EXISTS dbStringTable(
id integer PRIMARY KEY,
name varchar(40) NOT NULL CHECK (name <> '')
);
TRUNCATE dbStringTable;
- """
- );
+ """);
}
[Fact]
- public void ExecuteMulti()
+ [DapperAot]
+ public async Task Test()
{
-
+ var sourceCode = PrepareSourceCodeFromFile("DbString");
+ var executionResults = BuildAndExecuteInterceptedUserCode(sourceCode, methodName: "ExecuteAsync");
+
+ // TODO DO THE CHECK HERE
}
}
\ No newline at end of file
diff --git a/test/Dapper.AOT.Test.Integration/InterceptionExecutables/DbString.cs b/test/Dapper.AOT.Test.Integration/InterceptionExecutables/DbString.cs
new file mode 100644
index 00000000..aae57a2f
--- /dev/null
+++ b/test/Dapper.AOT.Test.Integration/InterceptionExecutables/DbString.cs
@@ -0,0 +1,20 @@
+using System.Data;
+using System.Data.SqlClient;
+using System.Linq;
+
+namespace InterceptionExecutables
+{
+ using System;
+ using System.IO;
+ using Dapper;
+ using System.Threading.Tasks;
+
+ public static class Program
+ {
+ public static async Task ExecuteAsync(IDbConnection dbConnection)
+ {
+ var res = await dbConnection.QueryAsync("SELECT count(*) FROM dbStringTable");
+ return res.First();
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/Dapper.AOT.Test.Integration/InterceptionExecutables/_Template.cs b/test/Dapper.AOT.Test.Integration/InterceptionExecutables/_Template.cs
new file mode 100644
index 00000000..9df40238
--- /dev/null
+++ b/test/Dapper.AOT.Test.Integration/InterceptionExecutables/_Template.cs
@@ -0,0 +1,18 @@
+namespace InterceptionExecutables
+{
+ using System;
+ using System.IO;
+ using Dapper;
+ using System.Threading.Tasks;
+
+ // this is just a sample for easy test-writing
+ public static class Program
+ {
+ public static async Task