Optimize the code ToCheckFiled

This commit is contained in:
sunkaixuan 2023-07-10 11:12:15 +08:00
parent 0004fb9f97
commit e7c893d15a
2 changed files with 10 additions and 1 deletions

View File

@ -23,5 +23,7 @@ namespace SqlSugar
public static Func<List<SplitTableInfo>> SplitTableGetTablesFunc; public static Func<List<SplitTableInfo>> SplitTableGetTablesFunc;
public static bool Check_StringIdentity = true; public static bool Check_StringIdentity = true;
public static Func<string,string> Check_FieldFunc;
} }
} }

View File

@ -66,7 +66,14 @@ namespace SqlSugar
/// <returns></returns> /// <returns></returns>
public static string ToCheckField(this string value) public static string ToCheckField(this string value)
{ {
if (value != null) //You can override it because the default security level is very high
if (StaticConfig.Check_FieldFunc != null)
{
return StaticConfig.Check_FieldFunc(value);
}
//Default method
else if (value != null)
{ {
if (value.IsContainsIn(";", "--")) if (value.IsContainsIn(";", "--"))
{ {