Interviews2 answers
How to use a table which is not having a Primary Key in entity framework?
2 Answers
Entity Framework requires primary keys for entities. But we can use the below type of query.
var seasons = db.Schedules.SqlQuery("SELECT DISTINCT Season FROM Schedule").TList();
yogesh soniPosted Jun 29, 2017, 6:11 PM EDT
The Entity framework will not support to have a table without primary key, but we can overcome this issue by accessing the table with additional column via a view and marking the new column as Primary in entity framework.
Vijayashankar PalanichamyPosted May 30, 2016, 8:52 AM EDT
