×
Mar 13, 2013 · If your SQL table does not have a primary key, you can still model it in Entity Framework, you will just need to define a key for that Entity.
Missing: 8677634/ | Show results with:8677634/
People also ask
Oct 22, 2010 · Changing the code to satisfy EF is a workaround in itself. Not all tables need a primary key nor they should be forced to. E.g. you've a Topic ...
Missing: 8677634/ | Show results with:8677634/
Jul 9, 2019 · Short answer, you don't. Entity Framework requires a key. Good news is you can effectively spoof a key if your table doesn't have one.
Missing: 8677634/ | Show results with:8677634/
Apr 14, 2016 · This let me build without any errors but I still could not retrieve all the data correctly. The workaround is to use a SqlQuery on the database.
Missing: 8677634/ | Show results with:8677634/
Apr 12, 2018 · I Figured out the problem. Composite Keys works for me: eg: In my Context I defined some keys, not only one, but three keys:
Missing: 8677634/ | Show results with:8677634/
Jul 14, 2022 · Always the entity has a primary key or a compound primary key. Use compound primary key like this: modelBuilder.Entity<UserRole>().
Missing: 8677634/ | Show results with:8677634/
Apr 3, 2018 · I have an old database which has some tables without primary key. Now I'm moving my old project to Asp.Net Core and using Entity Framework Core ...
Missing: 8677634/ | Show results with:8677634/
Sep 11, 2019 · I have a table and I want to insert entries with entity framework. By design, the table cannot have a meaningful primary key. CREATE TABLE dbo.
Missing: 8677634/ | Show results with:8677634/
In order to show you the most relevant results, we have omitted some entries very similar to the 8 already displayed. If you like, you can repeat the search with the omitted results included.