如何在Intellitrace事件中跟踪异步数据库操作?

我试图看到我的应用程序使用EntityFramework做的一些查询。 在我的方法中,我没有异步,我可以正常查看查询:

public List GetTools() { return EntityContext.ToList(); } 

在此处输入图像描述

但如果它喜欢:

  public Task<List> GetTools(int quantity) { return EntityContext.Take(quantity).ToListAsync(); } 

是否可以在IntelliTrace事件中获取异步方法的查询?

谢谢。

使用EF,您可以轻松地调试输出窗口和命令行。 这是我创建的快捷方法。

  public void EnableDebugging() { Database.Log = s => { Console.Write(s);//windows apps Debug.Write(s);//website apps }; } 

IntelliTrace当前不支持异步ADO.NET事件。 请在此投票支持此function: http : //visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/11356578-add-intellitrace-support-for-async-ado-net-events