Changes to nullable bool properties are not saved back to the db in EF4 however other fields which are nullable are updating without any issues. For example, if I execute simple query similar to the following:
EmployeeSurvey employeeSurvey = context.EmployeeSurveys.SingleOrDefault(s => s.EmployeeSurveyID == 60);
employeeSurvey.EmployeeSmokes = true;
employeeSurvey.OtherComments = "Test comment";
context.SaveChanges();
The OtherComments changes are successfully saved back to the db however the EmployeeSmokes property changes are not. The EmployeeSmokes property is a bool? and other nullable boolean fields have the same issue.
Additionally, the problem only occurs when changing/updating existing EmployeeSurvery records - all properties including EmployeeSmokes are successfully saved when creating/inserting new EmployeeSurveys.
I've also tried using the ApplyCurrentValues method as per this thread but unfortunately it hasnt helped.
Any ideas why this is happening?