Debugging LINQ in web applications.
I’ve been playing around with LINQ quite a lot recently following the release of Microsoft Visual Studio 2008 and the .NET Framework 3.5.
LINQ is an OR/M (object relational mapper) for C# and VB.NET, these videos by Beth Massi give a good introduction to LINQ and show just how powerful it is.
A lot of LINQ to SQL examples in the videos show how you can set the Log property of a data context to output to the console:
myContext.Log = Console.Out
Doing this allows you to view the SQL code that LINQ generates to interact with the database. This is fine if you are working with WinForms but not so great if you work on websites.
I found this neat class by Kris Vandermotten which outputs the LINQ log data to the Visual Studio Output window – far more useful if you are working with web apps.



