Using CascadeMode.StopOnFirstFailure on a validator level

前端 未结 2 1462
萌比男神i
萌比男神i 2021-02-19 19:00

From the FluentValidation documentation I learned that I can abort validation by setting the cascade mode.

RuleFor(x => x.Surname)
.Cascade(CascadeMode.StopOn         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 19:17

    According to the JeremyS' answer, I have misunderstood the purpose of the CascadeMode. It is in fact not intended to have effect on a validator level but only within a rule.

提交回复
热议问题