mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 调整 Aop 改为 event 事件;
- 调整 Ado.AopCommandExecuting/AopCommandExecuted 到 Aop.CommandBefore/After; - 增加 Aop.TraceBefore/After 事件;
This commit is contained in:
@ -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);
|
||||
};
|
||||
|
@ -18,7 +18,7 @@ namespace restful
|
||||
.UseAutoSyncStructure(true)
|
||||
.Build();
|
||||
|
||||
Fsql.Aop.CurdAfter = (s, e) =>
|
||||
Fsql.Aop.CurdAfter += (s, e) =>
|
||||
{
|
||||
if (e.ElapsedMilliseconds > 200)
|
||||
{
|
||||
|
Reference in New Issue
Block a user