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

Add example for Dapper to the SQL-Parameters wiki page #62

Closed
barsv opened this issue Jan 14, 2021 · 2 comments
Closed

Add example for Dapper to the SQL-Parameters wiki page #62

barsv opened this issue Jan 14, 2021 · 2 comments

Comments

@barsv
Copy link

barsv commented Jan 14, 2021

I propose to add the following to the end of the https://github.com/DarkWanderer/ClickHouse.Client/wiki/SQL-Parameters page:

---- start of the change

For Dapper

You need to pass parameters as Dictionary<string, object>.

For example, the following:

connection.QueryAsync<string>("select {p1:Int32}", new { p1 = 42 });

will not work. You need do it this way:

connection.QueryAsync<string>("select {p1:Int32}", 
    new Dictionary<string, object> { { "p1", 42 } });

---- end of the change

@barsv
Copy link
Author

barsv commented Jan 14, 2021

@DarkWanderer
Copy link
Owner

Thanks for suggestions - added first note into "ORM" section and edited the URL.

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