https://roslyn.codeplex.com/workitem/246 affects usage of code with the
latest build of Roslyn with Moq v4.2. The workaround involves ensuring a
closure is created. Updating affected tests to make ToString() calls on
local variables to create these closures.
- see line 2 of #874
- focus on `TextBox[For]()` and `ValidationSummary()`
related fixes included here:
- `TextArea[For]()` documentation incorrectly indicated their `htmlAttributes` parameters were dictionaries
- handle `htmlAttributes` parameters more consistently; create a dictionary only when necessary
- fixes#566 and part of #847
- allows compositions such as `@Html.Label("property", Html.Id("property"))`
and `@Html.Raw(Html.DisplayText("property"))` (this one is not recommended)
- adjust XML comments to match
- add missing XML comments to `HtmlHelperValueExtensions`
- nit: `TInnerModel` -> `TModelItem`
- increase XML comment consistency for changed methods
- generally make wording more consistent e.g. how we use words such as
"returns"
- use `<see langref="string|true|false|null"/>` more
- address all of #659 and a bit of #874 (avoid `public virtual` methods in
`HtmlHelper`)
- make `MetadataProvider` and `GetClientValidationRules()` `public` and
therefore available to extension methods
- remove unused `GetValidationAttributes()` overload
- make remaining `GetValidationAttributes()` overload (and not
`GetClientValidationRules()`) `virtual`, allowing derived classes to
change the attributes without overriding all callers
- reverse `GetValidationAttributes()` and `GetClientValidationRules()`
parameter order to match precedence
- add `GenerateName()` and `GenerateValidationSummary()` to make
`protected virtual` method names consistent
- `Name()`, `ValidationSummary()` and `TextArea()` are no longer `virtual`
because `protected virtual Generate*()` methods exist for all
This change consists of :
1. Conneg based on request headers, supports the following 3 scenarios:
a. ContentType property on ObjectResult set to null or is empty.
b. ContentType property on ObjectResult set to a single content type.
c. ContentType property on ObjectResult set to multiple content types.
2. Parsing Helpers, comparers and extensions for comparing various http headers.
3. Tests.
Open workitems:
1. Remodel JsonResult and ContentResult to be a derivation of ObjectResult.
2. Populate DeclaredType.
Conflicts:
src/Microsoft.AspNet.Mvc.Core/Formatters/OutputFormatterDescriptor.cs
src/Microsoft.AspNet.Mvc.Core/Microsoft.AspNet.Mvc.Core.kproj
src/Microsoft.AspNet.Mvc.Core/OptionDescriptors/OutputFormatterDescriptorExtensions.cs
src/Microsoft.AspNet.Mvc.Core/Properties/Resources.Designer.cs
src/Microsoft.AspNet.Mvc.Core/Resources.resx
src/Microsoft.AspNet.Mvc.HeaderValueAbstractions/MediaTypeHeaderValue.cs
src/Microsoft.AspNet.Mvc.HeaderValueAbstractions/MediaTypeWithQualityHeaderValue.cs
src/Microsoft.AspNet.Mvc/MvcOptionsSetup.cs
src/Microsoft.AspNet.Mvc/MvcServices.cs
test/Microsoft.AspNet.Mvc.Core.Test/Microsoft.AspNet.Mvc.Core.Test.kproj
test/Microsoft.AspNet.Mvc.Core.Test/OptionDescriptors/OutputFormatterDescriptorExtensionTest.cs
test/Microsoft.AspNet.Mvc.HeaderValueAbstractions.Test/MediaTypeHeaderValueParsingTests.cs
test/Microsoft.AspNet.Mvc.Test/MvcOptionSetupTest.cs
- remove `ViewContext.UnobtrusiveJavaScriptEnabled` property and all references
- avoid `ViewContext.GetFormContextForClientValidation()` calls since
ternary expression is more explicit and we were inconsistent
- improve `ValidationMessage()` comments
- don't treat `ModelState.IsValid` as if it were still nullable
1. Added HttpNotFound() to Controller.
2. Updated HttpStatusCodeResult to expose the StatusCode as a property.
3. Added unit tests for HttpNotFound() and for HttpStatusCodeResult.
4. Updated the MvcSample to add an action that uses HttpNotFound().
5. Brought back HttpNotFoundResult and added unit tests for it.
For pages that can pop back (e.g. Partial pages \ View Components), the
invoking component already creates a new ViewContext. ViewStart, Pages
and Layouts need to share the same Layout. This is required for sharing
ViewData values (such as title).
Fixes#861
- subclasses would not calculate a value because `ModelMetadata` constructor
set this property
- meant presence of a `[Required]` attribute in the model was ignored
- value comes from `Name` property of `[Display]` attribute
- use new property in `@Html.DisplayName()` and `@Html.Label()`; remove associated TODO comments
- this method delegates to a number of `ModelMetadata` properties
- no use cases for overriding; should not be `virtual`
- `ModelMetadata.DisplayName` override using `DisplayAttribute.GetName()` coming in next commit
RazorView was part of the previous commit but was separated to make it
easier to see the diff in RazorPage that was formerly named RazorView
Adding IRazorPage and changes per code review comments
* Introducing RazorPage and RazorPageOfT that represent the Razor
execution aspect of view execution. Moving view execution hierarchy behavior
(Layout, partial views etc) into a separate RazorView type.
* Renaming IVirtualPathViewFactory to IRazorPageFactory,
IRazorViewActivator to IRazorPageActivator
* Renaming VirtualPathViewFactor to FileBasedPageFactory to
correctly reflect what it does.
Fixes#814