Skip to content

Asp.Net core WebAPI ModelState automatic validation #18035

@MapleWithoutWords

Description

@MapleWithoutWords

Describe the bug

I have an interface, and accept what is an entity class PersonModel object, the object of property I call them to verify the label Required, this want to controller performs ModelState. IsValid to verify the model, but seems to request, does not go to the controller, automatic validation for me directly, I think I manually control the validation, could you tell me what method? Thank you very much!

To Reproduce

Further technical details

  • ASP.NET Core version: 2.2
  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version: vs2019

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions