public virtual void SaveChanges(JuryAtheleteEntities dbContext) { try { dbContext.SaveChanges(); } catch (Exception ex) { DbEntityValidationException validationException = ex as System.Data.Entity.Validation.DbEntityValidationException; if (validationException != null) { foreach (var entityValidationErrors in validationException.EntityValidationErrors) { foreach (var validationError in entityValidationErrors.ValidationErrors) { Logger.Error(validationError.PropertyName + "-" + validationError.ErrorMessage); } } } Logger.Error(ex); throw; } }