p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 (http://p2p.wrox.com/forumdisplay.php?f=472)
-   -   Pg 118 (http://p2p.wrox.com/showthread.php?t=75140)

DyerOppenheimer July 8th, 2009 08:58 AM

Pg 118
 
Is it me or is it just assumed that certain steps will be taken by the reader, I refer to the code on pg 118:

public static SelectList GetOccupationList(String occupation)
{

TheBeerHouseDataContext dataContext = new TheBeerHouseDataContext();
var Occupations = from occupationList in dataContext.Occupations
orderby occupationList.OccupationName
select occupationList;
return new SelectList(Occupations, "OccupationName", "OccupationName", occupation ?? "Business Owner");
}

On what page in Chapter 5 has "TheBeerHouseDataContext" created? in order for this code to compile?

Again on page 118:

public static SelectList GetCountryList(String country)
{
return new SelectList(Iso3166CountryCodes.CountryDictonary, "Key", "Value", country ?? "US");
}

Where in chapter 5 has the class "Iso3166CountryCodes" been defined?

nberardi July 8th, 2009 10:42 AM

Quote:

Originally Posted by DyerOppenheimer (Post 243598)
On what page in Chapter 5 has "TheBeerHouseDataContext" created? in order for this code to compile?

Read Chapter 4

Quote:

Originally Posted by DyerOppenheimer (Post 243598)
Where in chapter 5 has the class "Iso3166CountryCodes" been defined?

Somethings had to be left out, because they would have broken the flow of the book and didn't really do much to further the understand of creating a website or using MVC. Specifically some things dealing with the complex understandings of internationalization and ISO codes. It would have taken us a good 5 pages explaining ISO codes and diving in to internationalization to understand a little couple line class dealing with Iso3166CountryCodes. Plus then we would have been stepping on the purpose of the Internationalization and Globalization chapter.

We tried our best to make the book flow and to keep building on what the reader understood, but a couple things just didn't belong where they were first used. Because as you are probably aware application development is usually not a linear exerscise. Often times you have to do a couple things up front that you really planned on tackling later on.

Hope you have enjoyed the book thus far.

DyerOppenheimer July 8th, 2009 11:28 AM

Quote:

Originally Posted by nberardi (Post 243602)
Read Chapter 4



Somethings had to be left out, because they would have broken the flow of the book and didn't really do much to further the understand of creating a website or using MVC. Specifically some things dealing with the complex understandings of internationalization and ISO codes. It would have taken us a good 5 pages explaining ISO codes and diving in to internationalization to understand a little couple line class dealing with Iso3166CountryCodes. Plus then we would have been stepping on the purpose of the Internationalization and Globalization chapter.

We tried our best to make the book flow and to keep building on what the reader understood, but a couple things just didn't belong where they were first used. Because as you are probably aware application development is usually not a linear exerscise. Often times you have to do a couple things up front that you really planned on tackling later on.

Hope you have enjoyed the book thus far.




Somethings had to be left out, because they would have broken the flow of the book and didn't really do much to further the understand of creating a website or using MVC. Specifically some things dealing with the complex understandings of internationalization and ISO codes. It would have taken us a good 5 pages explaining ISO codes and diving in to internationalization to understand a little couple line class dealing with Iso3166CountryCodes. Plus then we would have been stepping on the purpose of the Internationalization and Globalization chapter.

We tried our best to make the book flow and to keep building on what the reader understood, but a couple things just didn't belong where they were first used. Because as you are probably aware application development is usually not a linear exerscise. Often times you have to do a couple things up front that you really planned on tackling later on.

Hope you have enjoyed the book thus far.[/quote]


I do appreciate you taking the time out to respond to my email, but just to be clear with my initial observations on reading the book so far; It's not that I don't understand the notion of Linq or appericate that in editing this book, certain assumptions were made about the reader, as well certain information had to be left out. It more the perfunctory nature, of what I have read in this chapter so far.

In chapter 4 yes, Linq is explained but at no point was it mention in the solution portion that the datacontext had to be done prior to starting the next chapter, I'm looking at page 83 marked solution, I don't see it.

With reference to your answer about my question concerning Iso3166CountryCode, a little comment that this class would be created in subsequent chapters(which I have yet to reach) would have been helpful.

I most certainly concur that programming is usually not a "linear exerscise", but I do expect a book of this quality to be consistent, with giving at least a "heads up" prior to the introduction of such material.

nberardi July 8th, 2009 11:59 AM

I will let Al address these concerns that you have since he worked on Chapters 4 and 5.

But my guess is that Al simply forgot to talk about the TheBeerHouseDataContext, because the core of the chapter was based off the Membership provider. You will notice however that in Chapter 6, I do cover TheBeerHouseDataContext because it is integral to understanding Chapter 6.

Also as for your second point about the ISO Country Codes, I still stand by my original statement. As you get farther along in the book there are going to be a couple of things that we simply don't talk about in the code. For the very fact that it is distracting to the actual subject of chapter.

Al_Katawazi July 20th, 2009 04:50 PM

Actually I did talk about the datacontext in chapter 5 at some point but I think it was simply cut via the editing process. The information was already present in chapter 6 and most of chapter 5 dealt with membership provider as nick indicated. I think perhaps in the next edition of this book we might move it. Thanks for the suggestion.

M3rcuryKT February 17th, 2011 05:17 AM

Can anyone please explain how the file TheBeerHouse.designer.cs came about?
It said the codes within the file was auto-generated. (which implies the file itself was auto-generated?)
If so, when would that happen? Would that imply that the namespace TheBeerHouse.Models (seen in the codes) was also auto-generated? How would that be possible?

Shall the namespace TheBeerHouse.Model rather be manually defined first (within which the partial class TheBeerHouseDataContext -- derived from System.Data.Linq.DataContext -- is properly defined so that one can intantiate it later? i.e.

TheBeerHouseDataContext dc = new TheBeerHouseDataContext();
If the file was auto-generated before this statement, then the logic would be going backward ?!

M3rcuryKT February 18th, 2011 12:31 AM

Oh never mind. I found answer to my own question, mostly by reading and do lab on page 179 ~


All times are GMT -4. The time now is 06:18 AM.

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