/// <summary> /// 是否数据库外键约束错误 /// </summary> private static bool IsRefrenceError(Exception exception) { var message = new Warning(exception).Message; return(message.Contains("DELETE 语句与 REFERENCE 约束") || message.Contains("a foreign key constraint fails")); }
/// <summary> /// 是否数据库外键约束错误 /// </summary> private static bool IsRefrenceError( Exception exception ) { var message = new Warning( exception ).Message; return message.Contains( "DELETE 语句与 REFERENCE 约束" ) || message.Contains( "a foreign key constraint fails" ); }