By default, your view inherits from System.Web.Mvc.WebViewPage<TModel>
You can optionally override this class, the default ASP.NET inheritance mechanism:
@inherits System.Web.Mvc.WebViewPage<List<CompanyName.MyProduct.MyCategory>>
Or you can simply simplify this, since MVC3 is like this:
@model List<CompanyName.MyProduct.MyCategory>
This sugar syntax has been simplified to enter code. This announcement gives you some things.
- View automatic casting object with preferred type
- You get a "model" property defined by a type that allows you to access your object methods and properties.
Just believe that this is a method that takes an object and passes it to the specified type that you provide
source share