I been stuck in a situation and I tried finding the solution for it on net but was not successful. I am new to MVC with Entity Framework, and it is throwing the exception wh
None of the answers worked for me, but in the end, for some reason, EF 6 seemed to interpret this as a query:
var patient = db.Patient.Where(p => p.ID == id);
while this returned the Model I needed and works for me:
var patient = db.Patient.Where(p => p.ID == id).FirstOrDefault();