Fluent Validation in MVC: specify RuleSet for Client-Side validation

后端 未结 3 647
自闭症患者
自闭症患者 2021-01-18 08:03

In my ASP.NET MVC 4 project I have validator for one of my view models, that contain rules definition for RuleSets. Edit ruleset used in Post action, when all c

3条回答
  •  盖世英雄少女心
    2021-01-18 08:43

    Adding to this as the library has been updated to account for this situation...

    As of 7.4.0, it's possible to dynamically select one or multiple rule sets based on your specific conditions;

    ControllerContext.SetRulesetForClientsideMessages("ruleset1", "ruleset2" /*...etc*);
    

提交回复
热议问题