Dapper icon indicating copy to clipboard operation
Dapper copied to clipboard

Generic Add Method for Dynamic Parameters

Open roend83 opened this issue 7 years ago • 7 comments

Addresses #958

roend83 avatar Mar 07 '18 13:03 roend83

Unfortunately this would be a breaking change. While we can add the generic versions, removing the previous ones is not an option until the next major release. Can you please add them back and a test that shows these fixing the issue?

NickCraver avatar Mar 07 '18 19:03 NickCraver

We actually noticed an issue with the missing non-generic Add methods and added them back.

I'm fine adding a test for the generic methods. Can you tell me what I have to do to run the tests?

roend83 avatar Mar 07 '18 20:03 roend83

@roend83 Ah yes, git is just doing a horrible job of diffing here - to run the tests just push :) Take advantage of the build server running them for you on this PR :)

NickCraver avatar Mar 09 '18 14:03 NickCraver

@NickCraver I added a couple tests that call the 2 new generic methods. Let me know if these look ok.

roend83 avatar Mar 10 '18 13:03 roend83

@NickCraver & @mgravell Are there any plans to pull this in soon?

dude0001 avatar Jan 28 '19 20:01 dude0001

Hey all, I just ran across this PR which looks to resolve an issue I've just run into:

DateTime? dateParam = default;
var params = new {  dateParam = dateParam };

var result = connection.ExecuteScalar<object>("SELECT 1 FROM table WHERE date = @dateParam", params);

I'm using a Postgres database, and receive an exception: could not determine data type of parameter $1.

Of course this is a silly example, but it gets the point across. Are there any plans for this PR to make it into the code base soon?

ghost1face avatar Apr 07 '20 06:04 ghost1face

@NickCraver @mgravell ping?

Patman0021 avatar Apr 09 '25 19:04 Patman0021