Browse Source

Synchronization code

pull/30/head
sunkaixuan 2 years ago
parent
commit
55628641c8
  1. 4
      Src/Asp.NetCore2/SqlSugar/Realization/Dm/DmProvider.cs
  2. 5
      Src/Asp.NetCore2/SqlSugar/Realization/Oracle/OracleProvider.cs

4
Src/Asp.NetCore2/SqlSugar/Realization/Dm/DmProvider.cs

@ -32,6 +32,10 @@ namespace SqlSugar
{ {
break; break;
} }
else if (item.Value != null && item.Value.ObjToString().Contains("||") && Regex.IsMatch(item.Value.Replace(" ", "").Trim(), @"\|\|@\w+\|\|"))
{
break;
}
sql = sql.Replace(item.Value, item.Value.Replace("@", UtilConstants.ReplaceKey)); sql = sql.Replace(item.Value, item.Value.Replace("@", UtilConstants.ReplaceKey));
} }
} }

5
Src/Asp.NetCore2/SqlSugar/Realization/Oracle/OracleProvider.cs

@ -29,6 +29,10 @@ namespace SqlSugar
{ {
break; break;
} }
else if (item.Value != null && item.Value.ObjToString().Contains("||") && Regex.IsMatch(item.Value.Replace(" ","").Trim(), @"\|\|@\w+\|\|"))
{
break;
}
sql = sql.Replace(item.Value, item.Value.Replace("@", UtilConstants.ReplaceKey)); sql = sql.Replace(item.Value, item.Value.Replace("@", UtilConstants.ReplaceKey));
} }
} }
@ -141,7 +145,6 @@ namespace SqlSugar
Check.ExceptionEasy(it.Message, $"错误:{it.Message},出现这个错的原因: 1.可能是参数名为关键词(例如 @user )2. SQL错误。"); Check.ExceptionEasy(it.Message, $"错误:{it.Message},出现这个错的原因: 1.可能是参数名为关键词(例如 @user )2. SQL错误。");
} }
}; };
public override void SetCommandToAdapter(IDataAdapter dataAdapter, DbCommand command) public override void SetCommandToAdapter(IDataAdapter dataAdapter, DbCommand command)
{ {
((MyOracleDataAdapter)dataAdapter).SelectCommand = (OracleCommand)command; ((MyOracleDataAdapter)dataAdapter).SelectCommand = (OracleCommand)command;

Loading…
Cancel
Save