获取实体框架核心中DbContext.SaveChanges的生成的SQL [英] Get generated SQL for a DbContext.SaveChanges in Entity Framework Core
本文介绍了获取实体框架核心中DbContext.SaveChanges的生成的SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Entity Framework Core中,是否有可能看到在 DbContext <上调用
SaveChanges()
方法时将应用的SQL。 / code>?
In Entity Framework Core, is it possible to see the SQL that will be applied when the SaveChanges()
method is called on the DbContext
?
推荐答案
您可以使用控制台记录器 EF核心记录器自动与.NET的记录器集成核心
,您可以在这里阅读:
https://www.entityframeworktutorial.net/efcore/logging-in-entityframework-core.aspx
you can use console logger "EF Core logging automatically integrates with the logging mechanisms of .NET Core " you can read about here : https://www.entityframeworktutorial.net/efcore/logging-in-entityframework-core.aspx
这篇关于获取实体框架核心中DbContext.SaveChanges的生成的SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文