From 6a4d4d213d9bf81aec0c56493e7d116092538f6f Mon Sep 17 00:00:00 2001 From: Victor Molostov <86685532+molostovvs@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:47:53 +0300 Subject: [PATCH] chore: fix dapper example (#186) parameters with the $ prefix are currently not supported, so we need to fix the example Co-authored-by: Victor Molostov <86685532+ConcreteEcho@users.noreply.github.com> --- 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 df94e8ea..d563e5e9 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");