Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Tag Helpers: Change ValidationSummaryTagHelper's property to ValidationSummary type (enum not a string) #1685

Closed
DamianEdwards opened this issue Dec 9, 2014 · 4 comments
Assignees
Milestone

Comments

@DamianEdwards
Copy link
Member

The MVC Tag Helpers include some properties that are enums, e.g. the ValidationSummaryTagHelper. Currently they are typed as string and attempt to convert the string to the appropriate enum value otherwise they throw. They should just be typed as the enum directly.

@DamianEdwards DamianEdwards added this to the 6.0.0-rc1 milestone Dec 9, 2014
@dougbu dougbu changed the title Tag Helpers: Enum properties should be typed as the Enum and not attempt any conversion Tag Helpers: Change ValidationSummaryTagHelper's property to ValidationSummary type (enum not a string) Jan 16, 2015
@dougbu
Copy link
Member

dougbu commented Jan 16, 2015

previous subject was "Tag Helpers: Enum properties should be typed as the Enum and not attempt any conversion". ValidationSummaryTagHelper is the only MVC tag helper that performs conversion.

@dougbu
Copy link
Member

dougbu commented Jan 16, 2015

@DamianEdwards current helper throws if it cannot parse the asp-validation-summary (string) value. once I fix this, the compiler will handle asp-validation-summary="Garbage" and similar errors.

what behaviour would you like for undefined ValidationSummary values e.g. asp-validation-summary="ValidationSummary)23"? compiler would be happy but should the tag helper throw or ignore the value?

dougbu added a commit that referenced this issue Jan 16, 2015
… enum

- #1685
- update tests and samples to match
- remove tests for case-insensitivity and invalid property values

Note .cshtml author is responsible for adding `@using Microsoft.AspNet.Mvc.TagHelpers`
- Microsoft.AspNet.Mvc.TagHelpers has no startup code and `MvcRazorHost` does
  not read `MvcOptions` anyhow
@dougbu
Copy link
Member

dougbu commented Jan 16, 2015

talked offline w/ @DamianEdwards:

  • undefined ValidationSummary values should throw
  • move the ValidationSummary type to the Microsoft.AspNet.Mvc namespace so .cshtml authors don't need to type Microsoft.AspNet.Mvc.TagHelpers.ValidationSummary.All or add the appropriate @using

dougbu added a commit that referenced this issue Jan 16, 2015
… enum

- #1685
- move `ValidationSummary` type to the `Microsoft.AspNet.Mvc` namespace
- update tests and samples to match
- remove tests for case-insensitivity of `ValidationSummary` property values
dougbu added a commit that referenced this issue Jan 16, 2015
… enum

- #1685
- move `ValidationSummary` type to the `Microsoft.AspNet.Mvc` namespace
- update tests and samples to match
- remove tests for case-insensitivity of `ValidationSummary` property values
dougbu added a commit that referenced this issue Jan 16, 2015
… enum

- #1685
- move `ValidationSummary` type to the `Microsoft.AspNet.Mvc` namespace
- update tests and samples to match
- remove tests for case-insensitivity of `ValidationSummary` property values
@dougbu
Copy link
Member

dougbu commented Jan 16, 2015

Fixed via 9b2a9e3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants