-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
SQL Table Function primary key issue #2417
Comments
Which EF Core version exactly do you use at runtime? |
Version 8.0.0 |
Have you tried 8.0.6?? |
No. I can't do that without affecting the solution and causing problems without first making sure the update doesn't break anything for anyone else working on the code. The solution is over a 1.5 million lines of code. |
8.0.6 is just a minor bug fix update from 8.0.0 - surely you can test your issue against that version locally?? I believe you are facing a bug that has been fixed in 8.0.6 |
So is your suggestion to upgrade to EF Core 8.0.6? |
@ghendric Yes! As I understand, you are running EF Core version 8.0.0 which has a bug, that you are hitting. Updating to 8.0.2 or later will fix that bug - update locally and run a test to verify that it works. |
ok got it.. thanks! |
If you like my free tools, I would be very grateful for a rating or review on Visual Studio Marketplace or even a one-time or monthly sponsorship |
I encountered an issue in the latest version of EF Core Power Tools v2.6.287 when referencing a SQL table function. Here is the error message I received:
"The entity type 'EntityTypeName' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943."
HasNoKey was being generated and called when executing the code, but the error occurred when trying to execute anything unrelated to the SQL function. It appears to be connected to how the code was generated by EF Core Power Tools. I downgraded to v2.6.140, ran the reverse engineer option, and this resolved the issue. The generated code layout differed from that of v2.6.287. I'm not sure if this difference is the cause, but I wanted to report the issue.
I'm using VS 2022 Pro 64-bit, Windows 11 64-bit, and the project solution is .NET 8.
The text was updated successfully, but these errors were encountered: