From 48f6754ad69c5bc196612ec23f4887062fa87e17 Mon Sep 17 00:00:00 2001 From: Nick Craver Date: Tue, 11 Sep 2018 22:28:11 -0400 Subject: [PATCH] Updte literal example to be a bit better --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index cd8f9b86..577cfae6 100644 --- a/Readme.md +++ b/Readme.md @@ -202,7 +202,7 @@ Literal replacements Dapper supports literal replacements for bool and numeric types. ```csharp -connection.Query("select * from User where UserId = {=Id}", new {Id = 1})); +connection.Query("select * from User where UserTypeId = {=Admin}", new { UserTypeId.Admin })); ``` 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