-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Incorrect RCS1077 suggestion to change OrderBy to Order in EF Core queries #1541
Comments
cc: @BenjaminBrienen |
Opened an issue in the relevant repository: This issue can be closed, I think. @josefpihrt |
Even if they add that in another version of EF Core (and they're notoriously understaffed and slow to do so), RCS1077 will be very annoying to leave enabled in any project that uses any version of EF Core that doesn't support it, which will be the majority of projects for a while. RCS1077 has enough other useful suggestions that I don't want to disable it completely, but it's also very frustrating to pragma disable it in all my queries that use ordering. This is something that should be handled properly in Roslynator. |
So Roslynator should special case every project that doesn't properly support IEnumberable methods? |
This isn't an https://learn.microsoft.com/en-us/dotnet/api/System.Linq.Queryable.OrderBy?view=net-8.0 Roslynator shouldn't suggest this for the |
I agree with @sid-6581 that it shouldn't be suggested for |
This issue is already fixed in EFCore. You need to update your dependency: dotnet/efcore#28634 https://github.com/dotnet/core/releases/tag/v9.0.0-rc.1 It is currently in release candidate status. |
As I explained above,that's not an acceptable solution. I'm on the latest released version, EF Core 9 won't be out until later this year, and even then, most people won't update immediately. |
I think everyone expressed their opinion. This needs to be fixed. Best would if it would be fixed by you, @BenjaminBrienen, as you implemented it. Let me know if you will be able to fix it in a next couple of days (The fix should be straightforward). |
I'm busy with other projects at the moment, sorry. |
Product and Version Used: 4.12.6
Steps to Reproduce:
Use
OrderBy(x => x)
in an EF Core LINQ expression.Actual Behavior:
Roslynator will suggest changing it to
Order()
, which isn't currently supported in EF Core as of version 8. UsingOrder()
will cause the code to fail at runtime when it can't be translated to SQL.Expected Behavior:
OrderBy()
used on anything that implementsIQueryable
should not trigger this suggestion.The text was updated successfully, but these errors were encountered: