问题
Quick question on LINQ to SQL generated queries output.
I am in a ASP.NET MVC project, Visual Studio 2008, and I am trying what's suggested in MSDN documentation:
MyDataContext _dc = new MyDataContext();
_dc.Log = Console.Out;
But nothing is being shown on "Output" window (CTRL+Alt+O).
Is there is something else I need to configure in order to make LINQ to SQL dumping debug info to Output window in Visual Studio 2008?
I don't know if it makes any difference, but my entities (and MyDataContext class) are located in a separate class library project.
回答1:
You can use LINQ to SQL Visualizer. Attach the debugger, add a breakpoint and you'll be able to use it.
来源:https://stackoverflow.com/questions/850024/tracing-linq-to-sql-generated-queries-in-asp-net-mvc