Let’s now look at a new feature we added with the ASP.NET
MVC 3 Beta – the @model directive. The @model directive provides a
cleaner and more concise way to reference strongly-typed models from view
files.
To see this in action, let’s look at a (super) simple
scenario where we want to implement a /Products URL that lists product
categories from a database:
Below is a simple ProductsController implementation that
implements the /Products URL. It retrieves a list of product categories
from a database, and then passes them off to a view file to render an
appropriate HTML response back to the browser: