gog*_*gog 7 c# asynchronous entity-framework visual-studio-debugging
我试图看到我的应用程序使用EntityFramework做的一些查询.在我的方法中,我没有异步,我可以正常查看查询:
public List<Tool> GetTools()
{
return EntityContext.ToList();
}
Run Code Online (Sandbox Code Playgroud)
但如果它喜欢:
public Task<List<Tool>> GetTools(int quantity)
{
return EntityContext.Take(quantity).ToListAsync();
}
Run Code Online (Sandbox Code Playgroud)
是否可以在IntelliTrace事件中获取异步方法的查询?
谢谢.
使用 EF,您可以轻松地调试到输出窗口和命令行。这是我创建的快捷方法。
public void EnableDebugging()
{
Database.Log = s =>
{
Console.Write(s);//windows apps
Debug.Write(s);//website apps
};
}
Run Code Online (Sandbox Code Playgroud)