- 调整 Aop 改为 event 事件;

- 调整 Ado.AopCommandExecuting/AopCommandExecuted 到 Aop.CommandBefore/After;
- 增加 Aop.TraceBefore/After 事件;
This commit is contained in:
28810
2020-03-02 18:57:53 +08:00
parent 32703e016a
commit 24cc8bc1da
58 changed files with 1109 additions and 638 deletions

View File

@ -31,20 +31,20 @@ namespace dbcontext_01
(cmd, log) => Trace.WriteLine(log)
)
.Build();
Fsql.Aop.SyncStructureBefore = (s, e) =>
Fsql.Aop.SyncStructureBefore += (s, e) =>
{
Console.WriteLine(e.Identifier + ": " + string.Join(", ", e.EntityTypes.Select(a => a.FullName)));
};
Fsql.Aop.SyncStructureAfter = (s, e) =>
Fsql.Aop.SyncStructureAfter += (s, e) =>
{
Console.WriteLine(e.Identifier + ": " + string.Join(", ", e.EntityTypes.Select(a => a.FullName)) + " " + e.ElapsedMilliseconds + "ms\r\n" + e.Exception?.Message + e.Sql);
};
Fsql.Aop.CurdBefore = (s, e) =>
Fsql.Aop.CurdBefore += (s, e) =>
{
Console.WriteLine(e.Identifier + ": " + e.EntityType.FullName + ", " + e.Sql);
};
Fsql.Aop.CurdAfter = (s, e) =>
Fsql.Aop.CurdAfter += (s, e) =>
{
Console.WriteLine(e.Identifier + ": " + e.EntityType.FullName + " " + e.ElapsedMilliseconds + "ms, " + e.Sql);
};

View File

@ -18,7 +18,7 @@ namespace restful
.UseAutoSyncStructure(true)
.Build();
Fsql.Aop.CurdAfter = (s, e) =>
Fsql.Aop.CurdAfter += (s, e) =>
{
if (e.ElapsedMilliseconds > 200)
{