This change provides caching for the results of searching for view
components and discovering their names.
In our ViewComponent perf test, selecting the component type was about 25%
of the execution of MVC (due to uncached reflection). This change brings
that down to about 1%.
This is a small change to remove uncached reflection. There are some other
code paths where use of view components results in a hotspot. Leaving
those issues to be tracked as part of a larger design issue.
- jQuery and jQuery-validation files were not being copied
- update to match more-recent VS templates
nit: simplify wwwroot/lib directory tree slightly
- #944
- name `string` expression name and `Expression<Func<TModel, TResult>>`
parameters "expression"
- single special case is `GenerateIdFromName(string fullName)` since every
other expression name is relative to the current
`ViewData,TemplateInfo.HtmlFieldPrefix` value
- applied from `IHtmlHelper` and `IHtmlGenerator` on up
- name `IHtmlHelper` and `IHtmlHelper<TModel>` parameters "htmlHelper"
- rename `TProperty` and `TValue` type parameters to `TResult`
nits:
- clean up abbreviated names in `CachedExpressionCompiler`
- change `ObjectToDictionary()`'s parameter name to `value`
- use `nameof` more to make renaming (and refactoring) easier in the future
- rewrap parameters and arguments to avoid long lines and orphans
This also fixes#1503.
Currently all model binders except mutable object binder are independent of validation code. The mutable object binder which needs to do some validation ( for scenarios involving [BindRequired] and [BindNever]).
We would be going with an approach where required validaiton happens in input formatters and model binders.
This is needed as validation for value types can best be done at creation time.
Followup PRs:
Introduce support for skipping validation (and not binding) for a particular property/type etc.
This feature allows routing to generate a link when the action that is
being linked-to does not yet exist. See the PR in routing for the actual
implementation changes. This PR just has a simple functional test for the
scenario.
- add `CachedDataAnnotationsMetadataAttributes.UIHint`
- set `ModelMetadata.TemplateHint` using `UIHintAttribute` or `HiddenInputAttribute`
- add doc comments for `TemplateHint`-related properties and methods
- add unit tests and use these attributes in functional tests
nits:
- cache and seal `CachedModelMetadata.IsCollectionType`
- correct doc comments for `ModelMetadata.RealModelType`
- add doc comments for `IsCollectionType`-related properties and methods
- add doc comments for `IsComplexType`-related properties and methods
- move `CachedModelMetadata.IsComplexType` right below `IsCollectionType`
- same for related fields and methods