Answer
Model validation runs immediately after model binding and before the action method executes.
- Validation rules are typically expressed via data annotations (e.g.,
[Required],[Range]). - Errors are added to
ModelState. - Controllers or Razor Pages check
ModelState.IsValidto decide whether to continue or return validation errors.
Validation can also be implemented via IValidatableObject or custom validators, ensuring that only valid data reaches business logic.