Quote:
|
But in the book the verbiage between "query" and "=" is not there. I just think that is should have been.
|
You can add it there, but you don't have to. The same principle applies:
Code:
Dim query = dc.titles
would work fine. dc.titles is a Table(Of Titles) and thus when the compiler sees this, it types query as a Table(Of Titles). So, the code in the book should compile just fine and when you hover your mouse over query it should tell you the type.
The code in the download is slightly different and does include the As clause.
Quote:
|
Because Option Infer was added specifically due to LINQ, it probably should have been reviewed at the beginning of the LINQ section or at least the reader should be asked to return to chapter 1 page 18 and review the compile options.
|
Yes, I agree. That would certainly make sense....
Quote:
|
I don't know but when you write a book for WROX, do you consider the possibility that the reader may skip ahead?
|
It depends on the book I guess. My Beginning books are meant to be read from start to end. I do add forward and back references where appropriate. With a reference type of book things would be different.
I think it's a fine balance. If you need to repeat some stuff in every chapter, you may get the opposite effect where people don't like the fact the same information is repeated over and over again ;-)
But in your case, a reference in the LINQ chapter to the compiler options and an explanation of type inference would have been useful.
Cheers,
Imar