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

TryValidateModel and TryUpdateModel don't revalidate the model if model is already validated after model binding #2071

@kirthik

Description

@kirthik

If I have an action

public object UpdateModel(Product product)
{
   product.Name = null;
   TryValidateModel(product)
 }

TryValidateModel(product) does not re-validate model since it is already validated after model binding.

We should clear model state errors and change the ValidationState to Unvalidated in ModelStateDictionary for TryValidateModel and TryUpdateModel

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions