From 9a859e2058c9a2c2d3bfc07d93fb1669060436ba Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 14 Jul 2023 15:07:31 +0800 Subject: [PATCH] Synchronization code --- Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs | 4 ++-- Src/Asp.Net/SqlSugar/Utilities/ValidateExtensions.cs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs b/Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs index 09afa7a13..8626eb5ed 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs @@ -129,7 +129,7 @@ namespace SqlSugar { foreach (var Parameter in parameters.OrderByDescending(x=>x.ParameterName?.Length)) { - if (Parameter.ParameterName != null && Parameter.ParameterName.ToLower().IsContainsIn(KeyWord)) + if (Parameter.ParameterName != null && Parameter.ParameterName.ToLower().IsContainsStartWithIn(KeyWord)) { if (parameters.Count(it => it.ParameterName.StartsWith(Parameter.ParameterName)) == 1) { @@ -138,7 +138,7 @@ namespace SqlSugar sql = Regex.Replace(sql, Parameter.ParameterName, newName, RegexOptions.IgnoreCase); Parameter.ParameterName = newName; } - else + else if(Parameter.ParameterName.ToLower().IsContainsIn(KeyWord)) { Check.ExceptionEasy($" {Parameter.ParameterName} is key word", $"{Parameter.ParameterName}Êǹؼü´Ê"); } diff --git a/Src/Asp.Net/SqlSugar/Utilities/ValidateExtensions.cs b/Src/Asp.Net/SqlSugar/Utilities/ValidateExtensions.cs index 975f0aa97..e3fcf3f07 100644 --- a/Src/Asp.Net/SqlSugar/Utilities/ValidateExtensions.cs +++ b/Src/Asp.Net/SqlSugar/Utilities/ValidateExtensions.cs @@ -26,6 +26,10 @@ namespace SqlSugar { return inValues.Any(it => thisValue.Contains(it)); } + public static bool IsContainsStartWithIn(this string thisValue, params string[] inValues) + { + return inValues.Any(it => thisValue.StartsWith(it)); + } public static bool IsNullOrEmpty(this object thisValue) {