示例#1
0
 public static T WithException <T, TException>(this T rule, string message,
                                               BrokenRuleSeverity severity)
     where T : Rule
     where TException : Exception
 {
     return(WithException <T, TException>(rule, message, severity, null));
 }
示例#2
0
 public static T WithException <T, TException>(this T rule, string message,
                                               BrokenRuleSeverity severity, string owner)
     where T : Rule
     where TException : Exception
 {
     rule.ExceptionActions.Add(new RuleExceptionFilter
     {
         ExceptionType = typeof(TException),
         Message       = message,
         Severity      = severity,
         Owner         = owner
     });
     return(rule);
 }
示例#3
0
 public BrokenRule(string message, BrokenRuleSeverity severity, string owner)
 {
     Message  = message;
     Severity = severity;
     Owner    = owner;
 }
示例#4
0
 public static T WithSeverity <T>(this T rule, BrokenRuleSeverity severity)
     where T : ValidationRuleBase
 {
     rule.Severity = severity;
     return(rule);
 }
示例#5
0
 public static ValidationRuleBase WithException <TException>(this ValidationRuleBase rule, string message,
                                                             BrokenRuleSeverity severity)
     where TException : Exception
 {
     return(WithException <ValidationRuleBase, TException>(rule, message, severity));
 }
示例#6
0
 public static BusinessRule WithException <TException>(this BusinessRule rule, string message,
                                                       BrokenRuleSeverity severity)
     where TException : Exception
 {
     return(WithException <BusinessRule, TException>(rule, message, severity));
 }
示例#7
0
 public static Rule WithException <TException>(this Rule rule, string message,
                                               BrokenRuleSeverity severity, string owner)
     where TException : Exception
 {
     return(WithException <Rule, TException>(rule, message, severity, owner));
 }