4 ms·
It's not moot: Dapper doesn't auto-generate the query for you, it's just a thin layer over .NET's SqlClient to reduce boilerplate of converting to and from C# o
by GenericsMotors 9y ago
It's not moot: Dapper doesn't auto-generate the query for you, it's just a thin layer over .NET's SqlClient to reduce boilerplate of converting to and from C# objects.
You still have to write your SQL statements, and in your example you'd still be able to refer to your array by name:
select SomethingID where AnotherThing in @yourNamedArrayParameter
More here: https://github.com/StackExchange/Dapper#list-support https://github.com/StackExchange/Dapper#list-support
If you're not using Dapper just use a user-defined table type to hold your data and join on it instead of using WHERE IN.
- dotancohen 9y agoVery cool, thank you!