public ConstructDomainObjectRuleValidationException(Type type, IConstructDomainObjectRule invalidRule)
     : base($"Construct {type.Name} failed. {invalidRule.Reason}")
 {
     DomainType  = type.Name;
     InvalidRule = invalidRule;
     Reason      = invalidRule.Reason;
 }
コード例 #2
0
 public static void CheckRule(IConstructDomainObjectRule rule)
 {
     if (rule.IsInvalid())
     {
         var stackTrace = new StackTrace();
         throw new ConstructDomainObjectRuleValidationException(stackTrace.GetFrame(1).GetMethod().DeclaringType, rule);
     }
 }