I have a List of patients. One of the properties of the Patient class is PatientId which is an int. My list is initialized like:
List<Patient> = new List<Patient>() { new Patient { PatientId = 1,
FirstName = "Jane",
LastName = "Doe"}};
When I access PatientId in my view with something like:
@Html.DisplayForModel(modelItem => modelItem.PatientId) //Error
I get an error:
Cannot convert lambda expression to type 'object' because it is not a delegate type