-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Feature: Generate Parameterized SQL #184
Comments
This looks interesting. I'll investigate this. |
I have modified the class |
I added some review comments, please take a look. About the unit-tests, why doesn't this work on your machine? And this PR did trigger CI build + test, take a look at the 3 fails. |
Closing this : PR has been merged. |
How would I actually use this feature? I'm using version 1.0.9.2 of the nuget package (released after this PR was merged), and it is still inlining constants instead of using sql parameters. |
After more testing, it seems to be a problem with If I use |
I created a new issue for this. |
Dynamically generated SQL contains inline constants, which causes SQL Server to compile the query plan every time a new constant is provided for the same query. Compilation is a costly operation and it can be avoided if the generated SQL is parameterized.
Expression.Constant
calls can be replaced by a "wrapped" constant as explained in the article below so that the generated SQL is parameterized and the query plan will be cached by the SQL Server.https://github.com/graeme-hill/gblog/blob/master/source_content/articles/2014.139_entity-framework-dynamic-queries-and-parameterization.mkd
The text was updated successfully, but these errors were encountered: