-
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
Translate int.Parse and similar #28287
Comments
You are often forced to use the CultureInfo overload by various Analyzers |
I'm interested in working on this issue. I'm planning on creating an SqlServerParseTranslator similar to SqlServerConvertTranslator. But the Regarding the tests cases, those are the ones I managed to find: efcore/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs Lines 1285 to 1619 in 781ca24
The Is there a reason for that? |
@MaRK0960 the issue is that string representations of booleans has lots of options (true/false/TRUE/FALSE/1/0?), and these aren't the same across C# and the database. I think it makes sense to leave out bool.TryParse specifically here. |
We translate
Convert<int>(string)
, but we could also translate x.Parse on the various primitive types (int, long...), as they're a common .NET API. We'd only support the simple overloads accepting a string, nothing more.Originally raised in #28282 (comment)
The text was updated successfully, but these errors were encountered: