当前位置:Gxlcms > 数据库问题 > EF6中的SQL监控

EF6中的SQL监控

时间:2021-07-01 10:21:17 帮助过:3人阅读

在MVC或WEBAPI中的监控

System.Action<string> action = (string message) => { Debug.WriteLine(message); };
Context.Database.Log = action;

参考:

Logging Database Commands in Entity Framework(在EF框架中记录数据库命令):
https://www.entityframeworktutorial.net/entityframework6/database-command-logging.aspx
Logging and intercepting database operations(日志记录和拦截数据库操作)
https://docs.microsoft.com/en-us/ef/ef6/fundamentals/logging-and-interception

EF6中的SQL监控

标签:message   http   ons   action   web   text   cti   sys   log   

人气教程排行