Creating the Domain Model

As I mentioned earlier, there are two kinds of model in an MVC framework: domain models and view models. It is common practice to create a separate class library project for the domain model and add it as a reference to the MVC framework project. The idea is that this helps enforce the separation between the domain model and the rest of the application. I usually take this approach on real projects, but to keep these examples simple, I am going to use the alternate approach of defining the model within the MVC framework project.

images Tip Putting the domain model into a separate project can be a little frustrating if you are ...

Get Applied ASP.NET 4 in Context now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.