Add support for parameter type mapping when the type is an IEnumerable. This is associated to a previous pull request I made a few months ago: #351. I've just discovered that this does not support IEnumerable types for example:
conn.QueryAsync<MyType>("SELECT * FROM dbo.MyType WHERE Id IN (@ids)", new { Ids = new[] { "a", "b", "c" });
A similar query today has been causing bad query plans due to mismatching data types. The Id column in MyTable is of type varchar but by default the parameters are created as nvarchar. This will address this issue and allow the custom type mapper to map nvarchar to varchar when it's an IEnumerable type.
Checklist
Please make sure your pull request fulfills the following requirements:
[X] Tests for any changes have been added (for bug fixes / features).
[ ] Docs have been added / updated (for bug fixes / features). Unsure of how to make edits to the wiki or if you'd want to make edits prior to this branch being approved
Type
This pull request includes what type of changes?
[X] Bug.
Breaking Changes
Does this pull request introduce any breaking changes?
Description
Add support for parameter type mapping when the type is an IEnumerable. This is associated to a previous pull request I made a few months ago: #351. I've just discovered that this does not support IEnumerable types for example:
A similar query today has been causing bad query plans due to mismatching data types. The
Id
column inMyTable
is of typevarchar
but by default the parameters are created asnvarchar
. This will address this issue and allow the custom type mapper to map nvarchar to varchar when it's an IEnumerable type.Checklist
Please make sure your pull request fulfills the following requirements:
Type
This pull request includes what type of changes?
Breaking Changes
Does this pull request introduce any breaking changes?