-
Notifications
You must be signed in to change notification settings - Fork 790
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
Different property order of a LINQ select expression cannot be translated #11131
Comments
Why this bug is marked as Impact-Low? I think it is a very serious issue. |
@albertwoo Same impact as #11127. |
@albertwoo I'll take a look, thanks for the detailed report. |
We should thank @jphilipps for the report 😊. |
Is the workaround to alwys use alphabetical ordering on the anonymous record? Also, could you please link a full project that contains the repro code |
@dsyme here is the repro code https://github.com/albertwoo/FSharpEFCoreRecordIssue Just set FSharpEFCoreRecordIssue fsharp project as startup project then run. The order issue should popup. |
This issue still hanpens in .NET 6, fsharp 6. |
Still happening in .NET 7 unfortunately :( Lost a few hours because of this |
If this is not going to be addressed in F# 8 , we could update the error message to mention that the workaround is to always use alphabetical ordering ? cc @vzarytovskii |
Different property order of a LINQ select expression cannot be translated
This issue has a strong connection to my findings on Stack Overflow but I think it is important to put it in the right place (hopefully). Furthermore, there is a similar issue (#3782) which highlights the usage of a tuple type for the select expression of a query.
For this issue I would like to emphasise that unfortunately, the F# LINQ expression cannot be translated, when the order of the property names of an anonymous or type record changes.
In order to evaluate the issue and make it testable I implemented some XUnit tests. Apart from that, I also have a minimum testable example which can be applied with LINQPad.
Any suggestions or solutions would be greatly appreciated.
The following error appears
Test and evaluation with LINQPad 6
I tested the behaviour with LINQPad in order to make the use case more simple. Therefore, I used the DemoDB which should be available for everyone.
Test and evaluation with a F# unit test project
Test result summary
I tested the behaviour with .NET 3.1 and .NET 5.0 (projects as well as LINQPad 6). Furthermore, all dependencies have been adjusted accordingly (e.g. Entity Framework 5.0 or 3.1).
Test outcome
EF core code first database .NET 5 project
F# xunit test project in order to evaluate the EF core database context access
The text was updated successfully, but these errors were encountered: