-
Notifications
You must be signed in to change notification settings - Fork 88
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
odata startswith uri differs from odata standard and causes entity framework to generate suboptimal sql #236
Comments
I don't know the answer why Breeze does that, but it may be that Entity Framework didn't work the same way back when Breeze was first tested. Frankly, I'm surprised that EF handles |
EF 6 |
@steveschmitt Can you foresee any problem with changing the code in our custom odata uri adapter to not add the eq true part to the end of startswith? |
@jgtestw It is fine for you to change the code. |
@steveschmitt Ok thanks |
@steveschmitt Do you want me to update the actual breeze source code too? Submit a pull request? |
Yes, please submit a pull request. |
ok i will |
The code that converts a startswith predicate to an odata uri generates the following uri
startswith(mobile,'0430404111') eq true
instead of
startswith(mobile,'0430404111')
This causes the sql generated by entity framework to be suboptimal. Why do you tack
eq true
onto the end of the startswith? The odata standard does not require this. It also makes entity framework generate suboptimal sql:((CASE WHEN ([Extent1].[Mobile] LIKE @p__linq__0 ESCAPE N''~'') THEN cast(1 as bit) WHEN ( NOT ([Extent1].[Mobile] LIKE @p__linq__0 ESCAPE N''~'')) THEN cast(0 as bit) END) = @p__linq__1)
instead of
[Extent1].[Mobile] LIKE @p__linq__0 ESCAPE N''~''
The text was updated successfully, but these errors were encountered: