diff --git a/Src/Asp.NetCore2/SqlSeverTest/Demo/Democ_GobalFilter.cs b/Src/Asp.NetCore2/SqlSeverTest/Demo/Democ_GobalFilter.cs index 2406df714..0e866cee0 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/Demo/Democ_GobalFilter.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/Demo/Democ_GobalFilter.cs @@ -32,6 +32,22 @@ namespace OrmTest var sql4 = db.Queryable().Filter("Myfilter",isDisabledGobalFilter:true).ToSql();//only Myfilter //SELECT [Id],[Name],[Price],[CreateTime] FROM [Order] WHERE Name='jack' Console.WriteLine(sql4); + + db.Aop.DataExecuting = (x, p) => + { + if (p.EntityColumnInfo.PropertyName == "CreateTime") + { + p.SetValue(DateTime.Now.AddDays(-10)); + } + }; + + var sql5= db.Updateable() + .SetColumns(it => new Order() + { + Name="A" + + },appendColumnsByDataFilter:true).Where(it=>it.Id==1).ToSqlString(); + Console.WriteLine(sql5); Console.WriteLine("#### Filter End ####"); }