Rule priority documentation #3277
-
Could you point me in the direction of some documentation of how the priority of rules work? I've been unable to find any. In v3.8 it was set like this: Csla.Validation.RuleSeverity.Warning |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Priority is to control the order the rules execute, the lower number will run first. You can run a required rule for example before a max length rule. |
Beta Was this translation helpful? Give feedback.
Priority is to control the order the rules execute, the lower number will run first. You can run a required rule for example before a max length rule.
If you want to use Warning, Info etc you set that in the execute method in the rule calling context.
context.AddWarningResult("Warning message..."); context.AddInformationResult("Info message..."); context.AddErrorResult("Error message...");