Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 84d867d

Browse files
committed
#增加SQL执行前后事件#
1 parent c711a3d commit 84d867d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎APIJSON.NET/APIJSON.NET/Data/DbContext.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ public DbContext(IConfiguration options)
1818
IsAutoCloseConnection = true,
1919
InitKeyType= InitKeyType.Attribute
2020
});
21+
Db.Aop.OnLogExecuted = (sql, pars) => //SQL执行完事件
22+
{
23+
24+
};
25+
Db.Aop.OnLogExecuting = (sql, pars) => //SQL执行前事件
26+
{
27+
28+
};
2129
}
2230
public SqlSugarClient Db;
2331
public DbSet<Login> LoginDb { get { return new DbSet<Login>(Db); } }

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /