This change removes reflection from validator providers, and instead relies on cached metadata in in the modelmetadata. In general this means that our MVPs don't need to cache anything, they just look at the metadata and create what they need. In the case of data-annotations, we update the model details provider to add validation attributes to the modelmetadata. This would allow someone to replace the DataAnnotationsValidatorProvider, but still use the metadata in these attributes. The change to the IModelValidatorProvider api (to use a context) is intended to minimize allocations. Currently each validator provider needs to return a list so you end up with N+1 lists (N validators + a final list to compine them all). This change will let us just create the final list (and a small context object). This is a very very high traffic API so it seemed worth doing. There's also some general massaging of namespaces and file locations. |
||
|---|---|---|
| .. | ||
| Microsoft.AspNet.Mvc.Common.Test | ||
| Microsoft.AspNet.Mvc.Core.Test | ||
| Microsoft.AspNet.Mvc.FunctionalTests | ||
| Microsoft.AspNet.Mvc.ModelBinding.Test | ||
| Microsoft.AspNet.Mvc.Razor.Host.Test | ||
| Microsoft.AspNet.Mvc.Razor.Test | ||
| Microsoft.AspNet.Mvc.TagHelpers.Test | ||
| Microsoft.AspNet.Mvc.Test | ||
| Microsoft.AspNet.Mvc.TestCommon | ||
| Microsoft.AspNet.Mvc.WebApiCompatShimTest | ||
| Microsoft.AspNet.Mvc.Xml.Test | ||
| WebSites | ||