View Single Post
  #1 (permalink)  
Old April 1st, 2011, 01:18 PM
mangel mangel is offline
Registered User
Join Date: Mar 2011
Posts: 17
Thanks: 4
Thanked 1 Time in 1 Post
Question Code to output the LINQ query that groups doesn't work on my system


A suggestion to to author of Chapter 10 of this book, specifically of the LINQ piece of the chapter, to be a little bit more descriptive of the grouping part of LINQ to SQL part. The sample code for this used two nested 'for each' loops which I hadn't noticed while I was typing in the code for it. The result of course was that it didn't work. This was a change in the approach shown in the previous examples. But I think that there is something about LINQ that implies that the result of the query is really a collection of collections and, because that wasn't explained at all, I had difficulty with the sample. I think that on initial exposure to LINQ queries one has to change his/her mindset from SQL to OOP. But that doesn't seem to hit you until you want to do a GROUP BY query in LINQ. I know that that is one of the characteristics of LINQ to SQL, but I think the idea really needs to be fleshed out when doing GROUP BY queries. Then the reader will truly begin to understand LINQ.

Because LINQ is new to me, I may be incorrect here; if so, an explanation would be useful. I know that the book deals with a whole lot more than LINQ, but I intend to read what it says about LINQ before I move on to a book that is dedicated to LINQ and VB .NET 2010. By the way, WROX doesn't have one.



Last edited by mangel; April 1st, 2011 at 06:16 PM. Reason: I figured it out. I can't type what I read.
Reply With Quote
The Following User Says Thank You to mangel For This Useful Post:
ksharkey (April 1st, 2011)