View Single Post
  #1 (permalink)  
Old January 2nd, 2011, 10:03 PM
Rushino Rushino is offline
Friend of Wrox
 
Join Date: Mar 2010
Posts: 99
Thanks: 21
Thanked 6 Times in 4 Posts
Default Errata on page 30 regarding DinnerRepository

Hello,

As i was writting code from page 30. Visual Studio give me an error on the bolded line in :

public void Delete(Dinner dinner) {
foreach (var rsvp in dinner.RSVPs) {
entities.RSVPs.DeleteObject(dinner.RSVPs);
}
entities.Dinners.DeleteObject(dinner);
}

i believe this should be entities.RSVPs.DeleteObject(rsvp); instead of
entities.RSVPs.DeleteObject(dinner.RSVPs);

Thanks.