Model Validation should mention ModelState.AddModelError
#27861
Labels
code help wanted
Sample code help wanted.
doc-enhancement
seQUESTered
Identifies that an issue has been imported into Quest.
Source - Docs.ms
Docs Customer feedback via GitHub Issue
aspnetcore/mvc/models/validation.md
may be the first page someone reads about validation. Yet it seems to miss the simplest method to return a validation error to the user (where built-in attributes fall short): ModelState.AddModelError.This method makes it particularly easy, for example, if the validation needs to check a database
The existing documentation leads the reader to believe that creating a custom
ValidationAttribute
or implementingIValidatableObject
are the only alternatives to built-in attributes.Thanks for your consideration!
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Associated WorkItem - 64069
The text was updated successfully, but these errors were encountered: