- don't call other extension methods
- #847 line 7
- remove extension methods that do nothing but pass through to the interface method
- weren't exactly ambiguous (interface method wins) but were useless
- #874 lines 3, 4, and 6
- correct `Value()` to treat a `null` expression name the same as `string.Empty`
- add missing `[NotNull]` attributes in `EditorExtensions` and for `GenerateIdFromName()`
- consistently pass `null` for default expression names to the helpers
- for example, from extension methods
- add test cases using `null` for expression name
nits:
- correct summary XML comment for `HtmlHelper` class
- use named parameters and prefer interface (not extension) methods in changed calls
- use `string.Empty` instead of `""` in a few tests
- fix problems at least with Roslyn compiler and VS IntelliSense or the Object Browser
- `<see langref="keyword"/>` generates nothing
- `<example>` at top level (outside `<summary>`) generates nothing
- curly braces don't become angle brackets outside `<see cref="reference"/>` references
- yeah, a point @yishaigalatzer asked about in a previous PR
- `<see href="reference"/>` is not valid
- correct some invalid use of angle brackets and remove useless empty elements
- correct unresolved XML comment references; generally, add namespace prefix
Symptoms for some of the above issues included
- generated XML comments such as `<!-- Badly formed XML comment ... -->`, usually indicating an unclosed element
- generated XML attributes such as `cref="!:..."`, indicating a broken reference
- in a couple of cases we had `<typeparamref cref="TOption"/>`; attribute should be `"name"`
Few wording changes beyond
- `"opening </form> tag"` -> `"<form> start tag"`
- `"closing </form> tag"` -> `"</form> end tag"`
Also correct two typos in `HtmlHelper`
Will create a unit test to ensure XML syntax doesn't degrade going forward. Separate PR.
- for now, check using `dir -r *.xml | sls '!'`
RazorTextWriter represents the result of rendering a page as a sequence of
strings rather than a concatenated string. This avoids building up large
strings in memory.
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