我正在嘗試記錄我記錄到表中的 SQL,但我收到了 OutOfMemoryException。我知道為什么會出現異常,但我不知道如何避免它。應用程序數據庫上下文:public class ApplicationDbContext : IdentityDbContext<ApplicationUser> { public ApplicationDbContext() : base("IdentityDBContext", false) { DbInterception.Add(new InsertUpdateInterceptor()); }}網絡數據實體: public WebDataEntities() : base("name=WebDataEntities") { }我收到異常是因為當我嘗試記錄 SQL 時,它卡在一個循環中,試圖記錄應該將 sql 記錄到數據庫的 sql。但是我使用了兩個不同的上下文,為什么它要嘗試兩次記錄 SQL?
EF6 攔截 SQL 并記錄到 DB OutOfMemoryException
慕婉清6462132
2021-09-19 15:33:38