Skip to content

Commit 48f6754

Browse files
committed
Updte literal example to be a bit better
1 parent d702fb8 commit 48f6754

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Literal replacements
202202
Dapper supports literal replacements for bool and numeric types.
203203

204204
```csharp
205-
connection.Query("select * from User where UserId = {=Id}", new {Id = 1}));
205+
connection.Query("select * from User where UserTypeId = {=Admin}", new { UserTypeId.Admin }));
206206
```
207207

208208
The literal replacement is not sent as a parameter; this allows better plans and filtered index usage but should usually be used sparingly and after testing. This feature is particularly useful when the value being injected

0 commit comments

Comments
 (0)