From 248e67c9c54690e22683754eeb47da25592985a9 Mon Sep 17 00:00:00 2001 From: Victor Molostov <86685532+ConcreteEcho@users.noreply.github.com> Date: Fri, 13 Sep 2024 23:25:24 +0300 Subject: [PATCH] chore: fix dapper example parameters with the $ prefix are currently not supported, so we need to fix the example --- examples/src/DapperExample/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/src/DapperExample/Program.cs b/examples/src/DapperExample/Program.cs index df94e8e..d563e5e 100644 --- a/examples/src/DapperExample/Program.cs +++ b/examples/src/DapperExample/Program.cs @@ -15,10 +15,10 @@ PRIMARY KEY (Id) ); """); -await connection.ExecuteAsync("INSERT INTO Users(Id, Name, Email) VALUES ($Id, $Name, $Email)", +await connection.ExecuteAsync("INSERT INTO Users(Id, Name, Email) VALUES (@Id, @Name, @Email)", new User { Id = 1, Name = "Name", Email = "Email" }); -Console.WriteLine(await connection.QuerySingleAsync("SELECT * FROM Users WHERE Id = $Id", +Console.WriteLine(await connection.QuerySingleAsync("SELECT * FROM Users WHERE Id = @Id", new { Id = 1 })); await connection.ExecuteAsync("DROP TABLE Users");