Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Professional ASP.NET MVC 2
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET MVC 2
This is the forum to discuss the Wrox book Professional ASP.NET MVC 2 by Jon Galloway, Scott Hanselman, Phil Haack, Scott Guthrie, Rob Conery; ISBN: Professional ASP.NET MVC 2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 2 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 2nd, 2011, 10:03 PM
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.
  #2 (permalink)  
Old January 2nd, 2011, 10:47 PM
Friend of Wrox
 
Join Date: Mar 2010
Posts: 99
Thanks: 21
Thanked 6 Times in 4 Posts
Default

What the hell. I sent an email to Wrox regarding this errata and got answered this :

Thank you for contacting Wiley Technical Support. Information about the code on page 30 can be found at:

http://www.wiley.com/WileyCDA/WileyT...Cd-ERRATA.html

code snippet 1-3.txt
This code snippet is designed to illustrate the associated concepts and is not designed to be complied. There are no errors in it but it will not run.


Please let us know if you have any more questions.


There IS an error in this code... how this fellowing code is supposed to be logical and free of any errors ?

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

You actually tell to delete the collection of RSVPs while looping through it.. furthermore.. deleteObject accept only an rsvp entity so it should be a single rsvp.

The logical way should be delete all RSVPs associated by the dinner and delete the dinner.

Anyone could reply telling that i am correct ?

Thanks.
  #3 (permalink)  
Old January 3rd, 2011, 11:22 AM
Friend of Wrox
Points: 539, Level: 8
Points: 539, Level: 8 Points: 539, Level: 8 Points: 539, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Location: Seattle
Posts: 106
Thanks: 1
Thanked 17 Times in 17 Posts
Default

You are correct. Don't expect a whole lot of response from the publishers. I've handed them dozens of errata and have never got any response. They don't appear to be monitoring the forums either.
  #4 (permalink)  
Old January 3rd, 2011, 11:33 AM
Friend of Wrox
 
Join Date: Mar 2010
Posts: 99
Thanks: 21
Thanked 6 Times in 4 Posts
Default

This is sad, ive expected some support from them look like i was wrong. Thanks for the info.
  #5 (permalink)  
Old January 4th, 2011, 11:46 AM
Registered User
 
Join Date: Jan 2011
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks Rushino

Quote:
Originally Posted by Rushino View Post
This is sad, ive expected some support from them look like i was wrong. Thanks for the info.
Thanks for posting the solution, Rushino...I'm just a newbie working through the book, and the intellisense error in VS2010 was pushing me down the wrong path.

I thought this error had something to do with autogenerated namespaces creating conflicting entities...you saved me a lot of time!
  #6 (permalink)  
Old January 4th, 2011, 05:21 PM
Friend of Wrox
 
Join Date: Mar 2010
Posts: 99
Thanks: 21
Thanked 6 Times in 4 Posts
Default

Bah no problems dude. I am glad it helped you. Through, i am a bit frustrated to discover that many have trouble with this book also on amazon.com there lots of poeple saying they having trouble and all. Lots of errata and no support. This is really disappointing. So i decided to return the book to amazon.
  #7 (permalink)  
Old January 4th, 2011, 05:30 PM
Registered User
 
Join Date: Jan 2011
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Rushino View Post
Bah no problems dude. I am glad it helped you. Through, i am a bit frustrated to discover that many have trouble with this book also on amazon.com there lots of poeple saying they having trouble and all. Lots of errata and no support. This is really disappointing. So i decided to return the book to amazon.
Sorry to hear that...I like the format of the book and want to work through it, so I hope I don't get hung up on too many typos :(

I already gave up on "Test-Drive ASP.NET MVC" because it was more out of date than this book. If we all went on ScottGu's blog and complained about the lack of support here, I'm sure he'd be proactive about it.
  #8 (permalink)  
Old January 4th, 2011, 06:19 PM
Friend of Wrox
 
Join Date: Mar 2010
Posts: 99
Thanks: 21
Thanked 6 Times in 4 Posts
Default

Quote:
Originally Posted by ebmudder View Post
Sorry to hear that...I like the format of the book and want to work through it, so I hope I don't get hung up on too many typos :(

I already gave up on "Test-Drive ASP.NET MVC" because it was more out of date than this book. If we all went on ScottGu's blog and complained about the lack of support here, I'm sure he'd be proactive about it.
Bah don't worry. It was a personnal choice. I know ScottGu is a guru in ASP.NET MVC and i wish i could keep the book but i really hate to hurt a wall in a book. Since he is a guru and well known dude in the domain this is quite a surprise to see a book with so many typos coming from him. I just didnt expected that.. furthermore... he rated 5 star some other book that i won't name here but this one seem to be liked by many so i will give it a try.

Thanks.
  #9 (permalink)  
Old January 24th, 2011, 05:09 PM
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)
}
  #10 (permalink)  
Old January 24th, 2011, 05:46 PM
Friend of Wrox
 
Join Date: Mar 2010
Posts: 99
Thanks: 21
Thanked 6 Times in 4 Posts
Default

I gave up on this book a while ago lol
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulty in DinnerRepository class dpuranik BOOK: Professional ASP.NET MVC 2 13 April 13th, 2011 03:27 AM
Errata Page Saranjiv BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 13th, 2010 05:14 PM
Error on page 38 in DinnerRepository adimauro BOOK: Professional ASP.NET MVC 2 3 July 6th, 2010 07:46 PM
Errata Page bonehead BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 27th, 2004 08:45 AM



All times are GMT -4. The time now is 08:34 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.