You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -202,7 +202,7 @@ Literal replacements
202
202
Dapper supports literal replacements for bool and numeric types.
203
203
204
204
```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}));
206
206
```
207
207
208
208
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