Skip to content

Commit 6a4d4d2

Browse files
authored
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 <[email protected]>
1 parent af07da4 commit 6a4d4d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/src/DapperExample/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ PRIMARY KEY (Id)
1515
);
1616
""");
1717

18-
await connection.ExecuteAsync("INSERT INTO Users(Id, Name, Email) VALUES ($Id, $Name, $Email)",
18+
await connection.ExecuteAsync("INSERT INTO Users(Id, Name, Email) VALUES (@Id, @Name, @Email)",
1919
new User { Id = 1, Name = "Name", Email = "Email" });
2020

21-
Console.WriteLine(await connection.QuerySingleAsync<User>("SELECT * FROM Users WHERE Id = $Id",
21+
Console.WriteLine(await connection.QuerySingleAsync<User>("SELECT * FROM Users WHERE Id = @Id",
2222
new { Id = 1 }));
2323

2424
await connection.ExecuteAsync("DROP TABLE Users");

0 commit comments

Comments
 (0)