Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

No key when using Entity Framework

So I'm building a web application where I have a table without a primary key. In the past I always did builder.hasNoKey since that was supported for .NET Core 3.0.

Now the application is built in .NET Core 2.2 which means builder.hasNoKey isn't supported.

Is there any solution to this except from adding a primary key?

This is the exact error I'm getting: "The entity type 'XXX' requires a primary key to be defined."
Can we have a peek from your entity class? It might be an issue in the class and not in the database being without PK.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by maryousJul 24, 2022 03:35 PM 0 159 Jul 24, 2022 03:35 PM
Last Post: maryous
[.NET] by gijivargijiAug 10, 2021 09:06 PM 4 215 Aug 10, 2021 09:06 PM
Last Post: Shadow_Cloud
[C] by F.A.S.TJul 24, 2018 03:24 PM 7 280 Jul 24, 2018 03:24 PM
Last Post: aeiro