mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 10:24:55 +08:00
Savesble support DiffLog
This commit is contained in:
@@ -84,6 +84,10 @@ namespace OrmTest.Demo
|
||||
db.Insertable(new DataTestInfo2() { Bool1=true, Bool2=false, PK=Guid.NewGuid(), Text1="a" })
|
||||
.EnableDiffLogEvent(new { title = "add DataTestInfo2" })
|
||||
.ExecuteReturnIdentity();
|
||||
|
||||
|
||||
db.Saveable(new Student() {Name="saveinsert"}).EnableDiffLogEvent().ExecuteCommand();
|
||||
db.Saveable(new Student() { Id=id, Name = "saveinsert" }).EnableDiffLogEvent().ExecuteCommand();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,20 @@ namespace SqlSugar
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISaveable<T> EnableDiffLogEvent(object businessData = null)
|
||||
{
|
||||
LoadInsertable();
|
||||
if (this.insertable != null)
|
||||
{
|
||||
this.insertable.EnableDiffLogEvent(businessData);
|
||||
}
|
||||
if (this.updateable != null)
|
||||
{
|
||||
this.updateable.EnableDiffLogEvent(businessData);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISaveable<T> InsertIgnoreColumns(Expression<Func<T, object>> columns)
|
||||
{
|
||||
LoadInsertable();
|
||||
|
||||
@@ -15,5 +15,6 @@ namespace SqlSugar
|
||||
ISaveable<T> InsertIgnoreColumns(Expression<Func<T, object>> columns);
|
||||
ISaveable<T> UpdateColumns(Expression<Func<T, object>> columns);
|
||||
ISaveable<T> UpdateIgnoreColumns(Expression<Func<T, object>> columns);
|
||||
ISaveable<T> EnableDiffLogEvent(object businessData = null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user