Browse Source

Synchronization code

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

6
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));
} }
} }
@ -156,7 +160,7 @@ namespace SqlSugar
{ {
sqlParameter.DbType = System.Data.DbType.AnsiString; sqlParameter.DbType = System.Data.DbType.AnsiString;
} }
if (parameter.IsRefCursor) if (parameter.IsRefCursor)
{ {
sqlParameter.DmSqlType = DmDbType.Cursor; sqlParameter.DmSqlType = DmDbType.Cursor;
} }

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