I did MVC 2 two years ago. I am now using MVC 4 and would like to confirm a few things (StackOverflow is down for maintenance just now for about an hour).

 

  1. In MVC 4, we do not need to create a ModelMetadata class to annotate with data annotations for data validation. We may simply annotate the model classes themselves.

    In other words, if we are using the EDM generator to generate a model and corresponding classes for us, then we may create a new set of partial classes with the same names and use data annotation attributes on those partial classes themselves.

    We do not need to create a new type of model metadata class and decorate *that* class with data annotation/attributes, like here: http://www.asp.net/mvc/tutorials/older-versions/models-%28data%29/validation-with-the-data-annotation-validators-cs

  2. For data annotations to work, we need a reference only to System.ComponentModel.DataAnnotations and not to Microsoft.Web.Mvc.DataAnnotations.
  3. We do not need to instantiate the default model binder in the Application_Start event in the Global.asax file.

Could you please confirm if my understanding is correct?