DCSIMG
.net 3.0 - Nati Dobkin

Browse by Tags

All Tags » .net 3.0 (RSS)
Logging Linq to SQL operations
Linq to SQL provide build in logger that logs all select, insert, update and delete operations, it executes. Very helpful tool when something goes wrong. You can find it under DataContext . Log property that takes TextWriter . Most of the samples you probably would find about the logger are setting the Console . Out to it, like this: DataContext dataContext = newMyDataContext (); dataContext . Log = Console . Out ; The more common scenario would be to write it to a text file. Changing this code to...

Posted by Nati Dobkin | 3 comment(s)