Skip to content
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

EF Core 6 generates EF Core 8 code #35500

Closed
JanTrichter opened this issue Jan 20, 2025 · 4 comments
Closed

EF Core 6 generates EF Core 8 code #35500

JanTrichter opened this issue Jan 20, 2025 · 4 comments
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported

Comments

@JanTrichter
Copy link

JanTrichter commented Jan 20, 2025

Question

Hi!
I was just investigating a bug when I saw this curiosity. I have a solution with several projects, all of them run EF Core 8. The project in which the bug originated is an exception though, as it only runs EF Core 6.

Now I checked the generated query in the console that caused the error and to my surprise it uses OPENJSON which according to the Breaking Changes for EF Core 8 documentation is only available since EF Core 8 and was handled differently in 6.

Unfortunately for me, the fix for my bug (EF.Constant) is only available in EF Core 8 which I can't use right now in my EF Core 6 project.

I was wondering if I'm missing something or if this is some kind of bug I stumbled over.

Thanks!


EF Core version

8 / 6

Database provider

Microsoft.EntityFrameworkCore.SqlServer

Target framework

.NET 8

Operating system

MacOS 15

IDE

JetBrains Rider 2024.1.6

@ErikEJ
Copy link
Contributor

ErikEJ commented Jan 20, 2025

@JanTrichter EF Core 6 never generates OPENJSON, so you use EF Core 8

@JanTrichter
Copy link
Author

@ErikEJ Yes, that's what I think happens but the bug I encountered is only fixable with EF Core 8 but I can't update right now. So I'm stuck with EF Core 6 features and EF Core 8 generated queries for some reason. I wanted to know why that is or if there's a way to fix this other than upgrading.

@roji
Copy link
Member

roji commented Jan 20, 2025

@JanTrichter there is probably some confused or crossed package references on your side - as @ErikEJ wrote, EF Core 6 does not "generate EF Core 8 queries" (e.g. OPENJSON). If you're can't find a problem in your own project, please put together a minimal, runnable repro and post it here - otherwise we can't help.

@JanTrichter
Copy link
Author

Issue solved itself somehow.

@roji roji closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2025
@roji roji added closed-no-further-action The issue is closed and no further action is planned. and removed waiting-for-response labels Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported
Projects
None yet
Development

No branches or pull requests

4 participants