Validation type names in unobtrusive client validation rules must be unique

前端 未结 5 979
予麋鹿
予麋鹿 2020-12-05 22:47

Validation type names in unobtrusive client validation rules must be unique. The following validation type was seen more than once: required

5条回答
  •  离开以前
    2020-12-05 23:36

    In my case I had added both NotEmpty and Length conditions to the validation rules at the same time.

    RuleFor(x => x.Code).NotEmpty().Length(1, 10);
    

    When I removed the NotEmpty condition the error disappeared.

提交回复
热议问题