From 35337082dc200f8663ed9c53cb97e954077d14dd Mon Sep 17 00:00:00 2001 From: kspdrgn Date: Mon, 20 Feb 2023 14:28:20 -0500 Subject: [PATCH] Add breaking test case for SQL Server Get, though this bug may affect all providers. Predicate is not filled out when using Get(value) but they work when using Get(object). I noticed that in `DapperImplementor.GetMapAndPredicate`, GetKeyPredicate is only called for Update and Delete, not Get. --- .../IntegrationTests/SqlServer/CrudFixture.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/DapperExtensions.Test/IntegrationTests/SqlServer/CrudFixture.cs b/DapperExtensions.Test/IntegrationTests/SqlServer/CrudFixture.cs index b4446ef7..285a8b1f 100644 --- a/DapperExtensions.Test/IntegrationTests/SqlServer/CrudFixture.cs +++ b/DapperExtensions.Test/IntegrationTests/SqlServer/CrudFixture.cs @@ -64,6 +64,15 @@ public class GetMethod : SqlServerBaseFixture [Test] public void UsingKey_ReturnsEntity() { + Person p0 = new Person + { + Active = true, + FirstName = "Foo", + LastName = "Bar", + DateCreated = DateTime.UtcNow + }; + Db.Insert(p0); + Person p1 = new Person { Active = true,