예제 #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));
 }