LINQ in Action - LINQ Book & News

LINQ in Action Errata (First Printing, February 2008)

All mistakes found in the first printing of LINQ in Action are posted here.
If you discover any mistakes in the book, you may post them as a comment to the errata for the second printing or in the forum.

The errata for the second printing is available here.


Chapter 3, page 91, Listing 3.5

Add a pointer to QueryReuse.csproj in the caption.

Chapter 3, page 92

Add a note. See this forum post.

Chapter 4, Page 128, Listing 4.7

Inherits=" Step1" has an unnecessary space

Chapter 4, page 133, line 8

Comma missing at the end of the line, after "select new { book.Title, book.Price"

Chapter 4, page 151, line 9

The listing should be:

from book in SampleData.Books
group book by book.Publisher into publisherBooks
select new {
  Publisher=publisherBooks.Key.Name,
  Books=publisherBooks,
  Count = publisherBooks.Count() };

Chapter 4, page 154, line 3 in section Cross join

isasequencethatcontainsacombonationofeach ismissingappropriatespaces

Chapter 4, page 157, listing 4.29

#1's do not belong here

SampleData.Books and .Select... should be indented with two more spaces

Chapter 6, page 216

The SQL query that is executed against the database as a result of running the Listing 6.8 / 6.9 example, is mentioned to be "SELECT TOP 2 [t1].[Title], [t1].[Price]...", but the SQL that is actually being generated by these listings appears to be slightly different:
SELECT [t1].[Title], [t1].[Price]
FROM (SELECT ROW_NUMBER() OVER (ORDER BY [t0].[Title], [t0].[Price]) AS [ROW_NUMBER], [t0].[Title], [t0].[Price]
FROM [dbo].[Book] AS [t0]) AS [t1]
WHERE [t1].[ROW_NUMBER] BETWEEN @p0 + 1 AND @p0 + @p1
ORDER BY [t1].[ROW_NUMBER]

Chapter 6, page 219, first query

book.PubDate should be be book.PublicationDate (twice)

Chapter 6, page 223

System.Enumerable.Linq.Join should be System.Linq.Enumerable.Join
Chapter 6, page 227
"From an object perspective, when we fetch the list of subjects, we don't know if there are any associated books attached to each book." should be "From an object perspective, when we fetch the list of subjects, we don't know if there are any associated books attached to each subject."
Chapter 6, page 231, section 6.5.2
"Thus, we could change our earlier implementation to indicate that we want to load all of the customers once..." should be "Thus, we could change our earlier implementation to indicate that we want to load all of the subjects once..."
Chapter 7, page 244, paragraph 3, line 1
"So far in this chapter we've focused on the three main attributes -- Table, Column, and Attribute." should be "So far in this chapter we've focused on the three main attributes -- Table, Column, and Association."

Chapter 7, page 258, end of the second-last paragraph

After the sentence "If the requested object is not in the cache, the database will be queried." there should be "This optimization did not make it into the initial release, but may return in future updates."

Chapter 8, page 287, Listing 8.16

The preceding paragraph says: "Here we see the code generated by the designer." However, the code sample represents the customized method, not the auto-generated method. The text should be "Here we see custom code that supplies additional information."

Chapter 8, Page 303, paragraph 2

"Set the name of the property to PropertyId." should be "Set the name of the property to PublisherId", and PublisherId should be in Courier.

Chapter 9, Page 327

LoadOptions.PerserverWhiteSpace should be LoadOptions.PreserveWhiteSpace

Chapter 10, page 376, line 13

Sytem should be System

Chapter 12, Page 473

The #2 in the second example doesn't belong there.

Chapter 13, page 513, line 1

EntitySpaces has no real support for LINQ and so shouldn't be in the list

More Titles From Manning (page 543)

"C++/CLI In Action" is referred to as "C##/CLI in Practice"

Published Wednesday, May 7, 2008 11:32 PM by Fabrice Marguerie

Comments

 

Marc Ziss said:

Page 133 (chaper 4)

Missing comma

     from book in SampleData.Books

     where book.Title.Length > 10

     orderby book.Price

     select new { book.Title, book.Price (should be comma here)

            Publisher=book.Publisher.Name, Authors=book.Authors.Count()

};

February 10, 2008 3:48 PM
 

Marc Ziss said:

pg 154

isasequencethatcontainsacombonationofeach

ismissingappropriatespaces

February 10, 2008 3:53 PM
 

Marc Ziss said:

Page 157

#1's do not belong here

     GridViewComplete.DataSource =   #1

       SampleData.Books   #1

         .Select((book, index) => new { Index=index, Book=book.Title});

     GridViewComplete.DataBind();

February 10, 2008 3:55 PM
 

Fabrice Marguerie said:

Thank you Marc!

We'll make sure this gets fixed in the next edition.

The isasequencethatcontainsacombinationofeach typo is a great one. Strange things can happen when a book is typeset!

February 11, 2008 1:54 PM
 

Gardner said:

p. 80, shouldn't the final, complete code be without the ProcessData class definition? And the actual code inside the DisplayProcesses, inside the if statement, should be

"..Add(new {ID = ..."?

March 5, 2008 12:38 AM
 

Fabrice Marguerie said:

Gardner,

No, we need the processes variable to be based on the ProcessData class, so we can use the TotalMemory extension method. This method works on an enumeration of ProcessData objects. Anonymous types are demonstrated a few lines below.

In addition, the ProcessData class is used to demonstrate auto-implemented properties - even if it's not clearly indicated in this listing.

Thanks for the suggestion,

Fabrice

March 5, 2008 1:53 AM
 

Laurion Burchall said:

Chapter 2, page 62

delegate void Action<T1, T2, T3>(T1 arg1, T2 arg2) should take 'T3 arg3' as a third argument

delegate TResult Func<T1, T2, T3, TResults>(T1 arg1, T2 arg2) should also take 'T3 arg3' as a third argument

March 25, 2008 10:47 AM
 

Laurion Burchall said:

Chapter 4, Page 128, Listing 4.7

Inherits=" Step1" seems to have an unnecessary space?

March 25, 2008 10:48 AM
 

Laurion Burchall said:

Chapter 9, Page 327

LoadOptions.PerserverWhiteSpace should be

LoadOptions.PreserveWhiteSpace

March 25, 2008 10:53 AM
 

Laurion Burchall said:

Chapter 12, Page 473

The #2 in the second example doesn't belong there.

March 25, 2008 10:55 AM
 

Laurion Burchall said:

"More Titles From Manning" (page 543)

"C++/CLI In Action" is referred to as "C##/CLI in Practice"

March 25, 2008 10:56 AM
 

Fabrice Marguerie said:

Laurion, thanks a lot for reporting these!

March 27, 2008 4:09 AM
 

David Miller said:

Page 223

There is a misstatement:

System.Enumerable.Linq.Join should be

System.Linq.Enumerable.Join.

April 3, 2008 6:34 AM
 

Fabrice Marguerie said:

Thank you David.

April 5, 2008 8:13 AM
 

Martillo said:

Page 287, Listing 8.16:

The preceding paragraph says: "Here we see the code generated by the designer." However, I believe the code sample represents the customized method, not the auto-generated method.

May 1, 2008 9:18 PM
 

Martillo said:

I don't know if you're making corrections to the code samples, but something that may be a little confusing to some is that in the  Chapter06to08.Sharp solution, the Ch8DataContext partial class file is named "Ch9DataContext.cs"

May 2, 2008 7:00 AM
 

Fabrice Marguerie said:

Thanks a lot Martillo.

We'll make sure your remarks are taken into account for the second printing.

I'll also update the code to avoid confusion.

Fabrice

May 2, 2008 7:30 AM
 

Martillo said:

Another source code observation:

In the LinqBooks.dbml file, the Author-to-AuthorUser and Publisher-to-PublisherUser associations seem to be pointing in the wrong direction, with the AuthorUser and PublisherUser classes indicated as parent classes instead of child classes... unless I'm reading it wrong...

May 2, 2008 9:44 AM
 

LINQ in Action - LINQ Book & News said:

All mistakes found in the second edition of LINQ in Action are posted here. If you discover any mistakes

May 7, 2008 2:39 PM
 

LINQ in Action - LINQ Book & News said:

LINQ in Action is doing well. We're all happy with the sales and all the reviews , on Amazon (5 stars

May 7, 2008 3:17 PM
 

Fabrice's weblog said:

LINQ in Action is doing well. We're all happy with the sales and all the reviews , on Amazon (5 stars

May 8, 2008 11:24 AM
 

Martillo said:

In the first edition source code, I believe the CSharp code for example 8-25 is not the correct example (compare with the VB code for listing 8-25)

May 9, 2008 3:15 PM
 

Fabrice Marguerie said:

Thanks Martillo. You're correct. We'll fix this.

May 12, 2008 4:37 AM
 

Alex said:

p 225 Code listing 6.19 the select has joinedbook.Title (and price) but in this example shouldn;'t it be book not joinedBook since there is no temp table?

May 23, 2008 3:18 AM
 

Fabrice Marguerie said:

Thanks Alex, I'll add this to the new errata.

May 26, 2008 2:29 PM
 

Bill Schroeder said:

The second to last sentence prior to listing 4.22 contains an error.  The sentence reads "We'll also reuse the same markup."

Actually, you need to add 1 line of code to the markup in the .aspx file too.  Since AutoGenerateColumns = false in the prior listing (4.21) you need to add a column for the count as well. This should do nicely;

<asp:BoundField HeaderText="Count" DataField="Count" />

Thanks for the great book!

Bill

May 30, 2008 6:36 PM
 

Fabrice Marguerie said:

Thanks Bill. Actually what you suggest is for the query on page 151. Count is not used in Listing 4.22.

May 31, 2008 4:38 AM
 

Wole said:

Chapter 6, 6.3.1 Filtering:

The generated SQL is incorrect. It should include all fields since we selected book (not book.Title).

June 14, 2008 12:42 AM
 

Fabrice Marguerie said:

Thanks Wole. That's correct. I've just added this to the new errata (http://linqinaction.net/blogs/main/pages/linq-in-action-errata.aspx).

June 17, 2008 2:14 AM
 

Wooley's LINQ Wonderings said:

When we wrote LINQ in Action, we took a bit of time to explain how the identity tracking system worked

August 21, 2008 6:25 AM
 

Rene said:

Page 420 (code located around the middle of the page)

When a new Publisher is created, I think the ID should be set to:

ID = Guid.NewGuid()

Currenlty is set to:

ID = Guid.Empty

January 8, 2009 8:13 AM
 

Fabrice said:

Rene,

This is correct. The same problem exists in the code snippets, until page 426 where the full source code is correct.

I'll add this to the errata for the second printing (http://linqinaction.net/blogs/main/pages/linq-in-action-errata.aspx).

Thanks.

January 18, 2009 4:43 AM
New Comments to this post are disabled