using System.Data.Entity.Validation; namespace CD67.FicheCollege.Entity { public partial class ModeleMVCEntities { /// /// Ajout d'une meilleure gestion des exceptions Entity pour la méthode "SaveChanges" /// /// public override int SaveChanges() { try { return base.SaveChanges(); } catch (DbEntityValidationException e) { var newException = new Internal.FormattedDbEntityValidationException(e); throw newException; } } } }