mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-19 17:51:36 +08:00
https://github.com/sunkaixuan/SqlSugar/issues/314 DiffLog Saveable
This commit is contained in:
@@ -8,8 +8,8 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
public class Config
|
public class Config
|
||||||
{
|
{
|
||||||
public static string ConnectionString = "server=.;uid=sa;pwd=@jhl85661501;database=SQLSUGAR4XTEST";
|
public static string ConnectionString = "server=.;uid=sa;pwd=haosql;database=SQLSUGAR4XTEST";
|
||||||
public static string ConnectionString2 = "server=.;uid=sa;pwd=@jhl85661501;database=sqlsugar4xtest";
|
public static string ConnectionString2 = "server=.;uid=sa;pwd=haosql;database=sqlsugar4xtest";
|
||||||
public static string ConnectionString3 = "server=.;uid=sa;pwd=@jhl85661501;database=sqlsugar4xtesT";
|
public static string ConnectionString3 = "server=.;uid=sa;pwd=haosql;database=sqlsugar4xtesT";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ namespace OrmTest.Demo
|
|||||||
var data = it.BusinessData;
|
var data = it.BusinessData;
|
||||||
var type = it.DiffType;
|
var type = it.DiffType;
|
||||||
var time = it.Time;
|
var time = it.Time;
|
||||||
|
Console.WriteLine(it.DiffType);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -86,8 +87,8 @@ namespace OrmTest.Demo
|
|||||||
.ExecuteReturnIdentity();
|
.ExecuteReturnIdentity();
|
||||||
|
|
||||||
|
|
||||||
db.Saveable(new Student() {Name="saveinsert"}).EnableDiffLogEvent().ExecuteCommand();
|
var enrity= db.Saveable(new Student() {Name="saveinsert"}).EnableDiffLogEvent().ExecuteReturnEntity();
|
||||||
db.Saveable(new Student() { Id=id, Name = "saveinsert" }).EnableDiffLogEvent().ExecuteCommand();
|
db.Saveable(new Student() { Id= enrity.Id, Name = "saveinsert" }).EnableDiffLogEvent().ExecuteCommand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,6 +131,7 @@ namespace SqlSugar
|
|||||||
public ISaveable<T> EnableDiffLogEvent(object businessData = null)
|
public ISaveable<T> EnableDiffLogEvent(object businessData = null)
|
||||||
{
|
{
|
||||||
LoadInsertable();
|
LoadInsertable();
|
||||||
|
LoadUpdateable();
|
||||||
if (this.insertable != null)
|
if (this.insertable != null)
|
||||||
{
|
{
|
||||||
this.insertable.EnableDiffLogEvent(businessData);
|
this.insertable.EnableDiffLogEvent(businessData);
|
||||||
|
|||||||
Reference in New Issue
Block a user