-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Specify CultureInfo in Controller make query not working #18831
Comments
@roji Any thoughts here? Could this be a Linux config issue? |
@utarn could you please submit a minimal project triggering the issue? |
@roji I'm trying to create a new simple project but still not able to reproduce the issue. Please wait. |
Now I'm have managed to reproduce the error. I put it here. https://github.com/utarn/testculture. Also the docker-compose file I use to test. both
and
then put [Internationalization] on controller class. both produce the same error. Expected behavior: Invalid login attempt. Output: This also happens in another controller where I have parameter type int or string too. |
Confirmed this is a bug in EF Core, submitted fix. |
We have this issue in production. We would really like this fix in 3.1. Why is it needed to wait until 5.0? Clearly a bug. It did work in 2.2. |
Can you implement a workaround in Postgres provider, @roji ? |
@ajcvickers what do you think? |
At the very worst, it's possible to work around this by extending the SqlGenerationHelper of the provider you're using and override GenerateParameterName. |
I have implemented suggested work-around and it appears to work Will show solution here if anyone else needs it. But I do believe this change would be nice to get into mainline, seems really trivial fix.
|
We already fixed this in the 5.0 branch, so the first 5.0 preview will already contain this fix. At the moment we don't plan to patch this in 3.x, since the workaround is very easy and not many people are affected. |
This backports the fix for #18831 to 3.1
PR not merged yet. |
This backports the fix for #18831 to 3.1
When 3.1.11 that contains this fix will be released? I have some reasons that cannot move to 5.0. If it is not going to release soon I will use workaround instead. |
Tomorrow (January 12th) |
Same issue |
@Tim1104 are you seeing this issue when using EF Core 5.0? If so, can you please open a new issue with a runnable code sample that shows the bug you're seeing? |
did this issue fixed in 3.1.11? |
Yes. |
I want to force the user UI to be in Thai language. So, I set cultureinfo using this code.
I also tried app.UseRequestLocalization and added only "th-TH" supported.
It's working fine on windows. But not in linux. I have tried running on asp.net core running docker image from mcr.microsoft.com. Still, it didn't work. I also tried on CentOS within and outside the container. It produces the same issue.
After adding this code, on Windows, the date time is rendered in Thai format properly. When running kestrel on linux and the query with parameter (Where clause) is specified in LINQ, it throws an exception.
PostgresException: 42703: column "__normalizedusername_0" does not exist
Steps to reproduce
Add this code.
and try running
Output on /Identity/Account/Login
Further technical details
EF Core version: 3.0.0
Database provider: Npgsql 4.1.1 and Npgsql.EntityframeworkCore.Postgresql 3.0.1
Target framework: .net core 3.0
Operating system: CentOS 7 within container, CentOS 7, container mcr.microsoft.com/dotnet/core/aspnet:3.0
IDE: Visual Studio 2019
The text was updated successfully, but these errors were encountered: