mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update diffflog
This commit is contained in:
parent
1887212362
commit
da62e541a3
@ -65,6 +65,9 @@ namespace OrmTest
|
||||
db.Updateable(data).EnableDiffLogEvent("--update Order--").ExecuteCommand();
|
||||
|
||||
db.Updateable(list.Take(5).ToList()).EnableDiffLogEvent("--update Order--").ExecuteCommand();
|
||||
|
||||
|
||||
db.Updateable<Order>().SetColumns(it=>it.Name=="asdfa").Where(it=>it.Id==1).EnableDiffLogEvent("--update Order--").ExecuteCommand();
|
||||
Console.WriteLine("#### Aop End ####");
|
||||
}
|
||||
}
|
||||
|
@ -807,8 +807,16 @@ namespace SqlSugar
|
||||
private List<DiffLogTableInfo> GetDiffTable(string sql, List<SugarParameter> parameters)
|
||||
{
|
||||
List<DiffLogTableInfo> result = new List<DiffLogTableInfo>();
|
||||
//var whereSql = Regex.Replace(sql, ".* WHERE ", "", RegexOptions.Singleline);
|
||||
var dt = this.Context.Queryable<T>().WhereClassByPrimaryKey(this.UpdateObjs.ToList()).ToDataTable();
|
||||
DataTable dt = null;
|
||||
if (this.UpdateParameterIsNull)
|
||||
{
|
||||
var whereSql = Regex.Replace(sql, ".* WHERE ", "", RegexOptions.Singleline);
|
||||
dt = this.Context.Queryable<T>().Where(whereSql).AddParameters(parameters).ToDataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
dt=this.Context.Queryable<T>().WhereClassByPrimaryKey(this.UpdateObjs.ToList()).ToDataTable();
|
||||
}
|
||||
if (dt.Rows != null && dt.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow row in dt.Rows)
|
||||
|
Loading…
Reference in New Issue
Block a user