ViewComponents and Controllers now follow the same rules exactly for what
types of classes they can be.
Also corrected a bug in a test for controllers. Closed-generic types can
be controllers, the test was wrong.
never that for `object`
- `ViewDataDictionary<TModel>.ModelMetadata` was for `object` after base
copy constructor got value from `ViewDataDictionary<object>`
- problem led to #1426 symptoms
- with copy constructor leaving `base.ModelMetadata==null` more often,
`ViewDataDictionary<TModel>.ModelMetadata` usually tracks `TModel` if
`Model==null`
nit:
- fix existing comment in main `ViewDataDictionary` copy constructor
- Cleaned up some existing bad code that worked around case sensitive TagHelperOutput.Attributes.
- Modified MergeAttributes to be case insensitive when it comes to merging class attributes.
- Added a test to verify the new MergeAttribute case insensitive class merging.
aspnet/Razor#186
- This involved adding the StringComparer.OrdinalIgnoreCase comparer to the TagBuilder's Attributes dictionary.
- Added tests to validate that all methods that made use of TagBuilder.Attributes abide by the new ignore case mechanic.
- Added two sets of tests to validate the new functionality of Object => Dictionary HTML helper tests.
- Modified a functional test that utilizes HTML Helpers to provide same attribute-different case objects.
- Fixed existing HTML helper tests to account for new ordering of attrbutes (dictionary no longer adds key value pairs, it sets them).
#1328
- Changed the Attributes dictionary to utilize a StringComparer.OrdinalIgnoreCase comparer.
- Changed TagHelperExecutionContext to ignore attribute casing.
- Updated the AllAttributes and HtmlAttributes dictionaries to ignore attribute casing.
- Added tests to validate their new behavior.
#186
This also comes with a rename of the namespace
Microsoft.AspNet.Mvc.ApplicationModel to
Microsoft.AspNet.Mvc.ApplicationModels.
Also tuned up some parameter and variable names for increased
understandability.