Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Parameters Naming for DB2 #1138

Open
bhassel-lincoln opened this issue Oct 9, 2018 · 1 comment
Open

Dynamic Parameters Naming for DB2 #1138

bhassel-lincoln opened this issue Oct 9, 2018 · 1 comment

Comments

@bhassel-lincoln
Copy link

Using Dapper for DB2 queries with the IBM.Data.DB2.iSeries driver works well, but there is an issue with the way parameters are handled. DB2 supports named parameters (and positional), but the parameter name MUST begin with the @ symbol, which DynamicParameters strips off by default: https://github.com/StackExchange/Dapper/blob/4e62055c5775aced61b848282ed180de0ab62161/Dapper/DynamicParameters.cs#L139

If the parameters are not named with the @ symbol, the variable matching defaults to positional within the statement, which can introduce hard-to-find bugs.

Because that Clean method is private/static, I don't see an easy way to change that default behavior. Is there some way to make that 'Clean' function optional at the connection/command level?

@amohata007
Copy link

https://github.com/amohata007/Hacktoberfest
contribute here....it is totally awesome and very easy to contribute.
@bhassel-lincoln @jbattermann @aggieben @paulcbetts @SamSaffron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants