public static void HandleSavePrimaryKeyException(Exception e, string fieldName = "ID") { PrimaryKeyExceptionInfo fk; if (SqlExceptionHelper.IsPrimaryKeyException(e, out fk)) { throw new ValidationError(String.Format(Texts.Validation.SavePrimaryKeyError, fk.TableName, fieldName)); } }