Skip to content

Non standard parameter conversions

Jacek edited this page Oct 21, 2019 · 12 revisions

There are also built-in parameter conversions:

  • listDirectParamBuilder modifies sql statement by replacing parameter with list of comma-separated values. E.g.

    select * from post where id in (@postIds)

    executed with [1, 2, 3] as a parameter, is transformed to

    select * from post where id in (1, 2, 3)

    Queries with literals in an in clause are very efficient, but they shouldn't be used with collections of strings.

  • listParamBuuilder modifies sql statement by replacing one parameter with many parameters representing elements of the list. E.g. the query above with the same parameter would be transformed to

    select * from post where id in (@postIds1, @postIds2, @postIds3)
Clone this wiki locally