It would help me understand LINQ a little bit better that's all.
I tried using the SQL Profiler but I'm not sure how I can get it to show the actual SQL commands.
ScottGu's blog has a great post on the subject here: http://weblogs.asp.net/scottgu/archive/2006/09/01/Understanding-LINQ-to-SQL-Query-Translations.aspx
There is a query visualizer you can use by hovering over the object in the debugger.
Use the Log property of the DataContext object:
using (var dc = new DataContext())
{
dc.Log = Console.Out; // Outputs the SQL statement to a System.IO.TextWriter object
var customers = dc.Customers.Single(c => c.Customer_ID == 7);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With