I am learning ASP.NET MVC and I like it. However, I am very confused about the right approach to namespacing my models.
While dissecting the NerdDinner sample app I noticed that everything in the Models folder belongs to the Models namespace. The data mapping classes, repositories, error rule management, etc., belong to the same namespa...
In this code from Microsoft's MVC Tutorial NerdDinners:
public class DinnerRepository {
private NerdDinnerDataContext db = new NerdDinnerDataContext();
//
// Query Methods
public IQueryable<Dinner> FindAllDinners() {
return db.Dinners;
}
public IQueryable<Dinner> FindUpcomingDinners() {
return from dinner in db.Dinners
...
On this page:
http://nerddinnerbook.s3.amazonaws.com/Part4.htm
After the controller is added, I can browse to http://localhost:xxxx/dinners and it works as expected. My question is how does it know to use "Dinners"? Where is "Dinners" located? My controller is named DinnersController so how did the word Dinners become meaningful. I...