2 ms·
If you're using an ORM then you don't worry about creating the prepared statement or SQL string yourself, so the entire issue is moot (See GP post).
by dotancohen 9y ago
If you're using an ORM then you don't worry about creating the prepared statement or SQL string yourself, so the entire issue is moot (See GP post).
- GenericsMotors 9y agoIt'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!