Errata

Programming Entity Framework: Code First

Errata for Programming Entity Framework: Code First

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 21
Example 2-6

this line - context.Destinations.Add(destination); Gives this SqlException - An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in EntityFramework.dll Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server) What do we do now?

Anonymous  Apr 29, 2017 
Mobi Page 46
4th paragraph after 2nd code block just before the next section

(I am using the Kindle version - I believe that is the Mobi format) The wrong namespace is referenced in the following paragraph: "You'll notice that the DatabaseGeneratedOption enums are within the System.ComponentModel.DataAnnotations namespace in the EntityFramework.dll..." The namespace is partially right, it is only missing ".Shema" as in "System.ComponentModel.DataAnnotations.Schema" I don't what version of the EntityFramework.dll assembly you were using at time of writing but I am using dll version 6.0.0.0, Runtime v4.0.30319. Thanks, John

John Gilmore  Mar 02, 2014 
PDF Page 46
After "Or you can create a separate statement"

modelBuilder.Entity<Person>() .HasKey(p => t.SocialSecurityNumber); Should be: modelBuilder.Entity<Person>() .HasKey(p => p.SocialSecurityNumber); Or: modelBuilder.Entity<Person>() .HasKey(t => t.SocialSecurityNumber);

Jason Briggs  Jun 22, 2015 
Printed Page 60
1st paragraph

Text reads: "You'll also need to be sure that the you add this AddressConfiguration to the model". Issue: "that the" in the middle of the sentence Suggestion: "You'll also need to be sure that you add this AddressConfiguration to the model".

Thomas Fleming  Jul 16, 2016 
Printed Page 65
2nd last paragraph

Text reads: "Figure 4-2 attempts to help you visualize this relationship the way the model builder sees it." Issue: The preceding Example 4-5 creates a 0..1 to Many relationship between Lodging and Destination. Figure 4-2 shows a 1 to Many relationship. The subsequent paragraph and Example 4-6 is actually the relationship matching Figure 4-2.

Thomas Fleming  Jul 16, 2016 
Printed Page 173
1st paragraph

Text reads: "... the Name column is having its maximum length changed to 50." Error: The code shows the maximum length being changed to 100, not 50. Suggestion: Change the code to match the text.

Thomas Fleming  Jul 16, 2016