Zorthgo
Zorthgo

Reputation: 2977

Intercept the Model Validation in asp.net Core

I've been trying to figure out which method sets the ModelState in an asp.net WebApi controller. I need to be able to inspect the ModelState.IsValid as the ModelState property is set. I've tried overriding a bunch of methods, to no avail.

Upvotes: 0

Views: 1810

Answers (1)

Turbot
Turbot

Reputation: 5227

the model validation support from validationAttribute and many can be found in System.ComponentModel.DataAnnotations

if you want to customize your own model validation, you can create custom validation

Upvotes: 2

Related Questions