My Add/Delete functions all work correctly. However when I edit I get a validation error message from Entity.
The error is: {"Validation failed for one or more entities. See 'EntityValidationErrors' property for more details."}
Upon looking at EntityValidationErrors it only states: {System.Data.Entity.Validation.DbEntityValidationResult}
I am passing the model from my edit page to a Post/Edit method stub.
[HttpPost]
public ActionResult Edit(EmployeeRoadsideAssistance employee)
{
AlphaDBEntities db = new AlphaDBEntities();
db.Entry(employee).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Edit", new { id = employee.id });
}
It fails on save changes. The problem also exits if I make no changes to the actual model. So if I add the new person, then click edit, then click edit without making any changes I still get the error.
EDIT
Thanks to the wonderful comment by DavidG I was able to see the real error which stated that I was trying to pass a null to a required column.
This was because I pre-fill these during the "Add" step and so the "Edit" step doesn't have them in the model. I added hidden fields to accommodate the pre-filled columns and it works now.