I'm using EF 5 with Code First POCO.
Here is the repository's SaveChanges implementation:
public virtual List<DbEntityValidationResult> SaveChanges()
{
var errors = new List<DbEntityValidationResult>();
try
{
DbContext.SaveChanges();
}
catch (DbEntityValidationException ex)
{
errors.AddRange(ex.EntityValidationErrors);
}
return errors;
}
A single validation error causes no entities to be written to the database. I had expected valid entities to be written out and to receive errors for invalid entities.
Is this how EF is supposed to act?