Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

How to log your LINQ query

5.00/5 (3 votes)
20 Oct 2011CPOL 7.6K  
I prefer to use ToTraceString() on the ObjectQuery:http://msdn.microsoft.com/en-us/library/system.data.objects.objectquery.totracestring.aspx[^]It's less intrusive as I don't have to instantiate and dispose the StreamWriter and I have more control over where and how I log the resultant...
I prefer to use ToTraceString() on the ObjectQuery:

http://msdn.microsoft.com/en-us/library/system.data.objects.objectquery.totracestring.aspx[^]

It's less intrusive as I don't have to instantiate and dispose the StreamWriter and I have more control over where and how I log the resultant output.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)