View Single Post
  #9 (permalink)  
Old January 24th, 2011, 05:09 PM
Olin Olin is offline
Registered User
 
Join Date: Jan 2011
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
Default Errata updated (finally)

In the past few weeks there have been a lot of additions to the Errata page, including this issue:

30 Error in Code
Code Snippet 1-3 in the DinnerRepository class, the Delete(Dinner dinner) method:

Code:
foreach(var rsvp in dinner.RSVPs){
entities.RSVPs.DeleteObject(dinner.RSVPs)
}
This does not work, and throws a compliation error. The error is also repeated in the Code Snippet1-3.txt download. The correct code should be:

Code:
foreach(RSVP rsvp in dinner.RSVPs.ToList()){
entities.RSVPs.DeleteObject(rsvp)
}