View Single Post
  #3 (permalink)  
Old April 4th, 2011, 04:39 PM
mangel mangel is offline
Registered User
Join Date: Mar 2011
Posts: 17
Thanks: 4
Thanked 1 Time in 1 Post
Smile One more suggestion

I believe that to be most helpful to the reader of the LINQ section of Chapter 10 the author should put all the sample code into one project. The reason is that doing so will create a few issues that do not show up when each code example is put into a separate project.

My inclination as I was reading was to do it this way. The result was that I had to work through a few gotchas that were not explained in the book.

Thanks to Imar I got the answers I needed. The solution was to instantiate the data context separately for each example, execute the sample code, and then dispose of it using its dispose method. This would have been necessary if one project had been used in order to get it to work in all cases.

I also put each sample, especially the ones with database updates involved, into a separate try/catch block.


Reply With Quote