I'm just reading Programming EF (now at chapter 4) but trying all the code samples on VS 2012 and .Net 4.5.
Is that the reason why I get different results in the "Shaped Data Returned by Queries" sample p.108/109 (and also in the next "Shaped Data from Entity SQL" sample p.109/110, and in the "Deferred Loading Entity Collections with Load" sample p.111) ?
In the two Shaped Data samples (LINQ to Entities and Entity SQL) I do not get the same the output than in the book.
For the two registered addresses of Mr. Alderson I get the right address count:
City: Montreal, LastName: Alderson
LastName: Alderson, # Addresses: 2
.....Montreal
City: Montreal, LastName: Alderson
LastName: Alderson, # Addresses: 2
.....Montreal
Why do I get already 2 addresses when reaching the first address of Mr Alderson ???
In the "Deferred Loading Entity Collections with Load" sample p. 111 I first try to copy the code without the contact.Address.Load(); call to verify that I get all address counts to 0...
...But surprisingly, I noticed all the Address counts were right without an explicit loading ???
Is there something like new automatic dynamic loading functionnality beeing added to the .Net 4.5 ?
And if so, what about the remark you wrote in the first paragraph of the "Deferre Loading and Eager Loading Queries" chapter : "Consider a typical model for sales information. [...] Can you imagine if you queried for contacts, and without expecting it, the entire contents of the database were returned-because it was related?" ?
Thank you for your explanations.












