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

ModelState error for FormatException should show DisplayName of the problematic property if available #3227

Closed
danroth27 opened this issue Sep 29, 2015 · 1 comment
Assignees
Milestone

Comments

@danroth27
Copy link
Member

ModelStateDictionary adds Resources.ModelError_InvalidValue_GenericMessage and Resources.ModelError_InvalidValue_MessageWithModelValue messages when a FormatException occurs. This message includes the full key (property / collection path) e.g. "model.Customer.Name". For consistency with MVC 5 and usability, should instead use the DisplayName of the problematic property and fall back to the property name.

@danroth27 danroth27 added this to the 6.0.0-rc1 milestone Oct 5, 2015
dougbu added a commit that referenced this issue Oct 22, 2015
…atException` and `OverflowException`

- #3227
- much of change is to tests, creating and passing `ModelMetadata`
- updated `InputFormatterContext` to make `ModelMetadata` available to `JsonInputFormatter`
  - walk `ModelMetadata` tree to get information about property with an issue
- add missing `null` checks in `ModelStateDictionaryExtensions`
dougbu added a commit that referenced this issue Oct 22, 2015
…atException` and `OverflowException`

- #3227
- much of change is to tests, creating and passing `ModelMetadata`
- updated `InputFormatterContext` to make `ModelMetadata` available to `JsonInputFormatter`
  - walk `ModelMetadata` tree to get information about property with an issue
- add missing `null` checks in `ModelStateDictionaryExtensions`
@dougbu
Copy link
Member

dougbu commented Oct 22, 2015

40b7636

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