Exemple #1
0
 public IFieldValidatorConfig Then(ISelfReferencingRule @ref, CapturedConstraint constraint)
 {
     try
     {
         CollectSingleSelectorVisitor visitor = rule.Accept(new CollectSingleSelectorVisitor());
         return(Then(visitor.SelectorPath, visitor.Alias, constraint));
     }
     catch (InvalidOperationException ex)
     {
         throw new InvalidOperationException("A self referencing rule (It) can only be used when a single field is used in the When clause.", ex);
     }
 }
Exemple #2
0
 public void For(ISelfReferencingRule selector, string alias = null)
 {
     try
     {
         CollectSingleSelectorVisitor visitor = rule.Accept(new CollectSingleSelectorVisitor());
         For(visitor.SelectorPath, alias);
     }
     catch (InvalidOperationException ex)
     {
         throw new InvalidOperationException("A self referencing rule (It) can only be used when a single field is used in the When clause.", ex);
     }
 }
Exemple #3
0
 public void ForEachIn(ISelfReferencingRule selector, string alias = null)
 {
     try
     {
         //TODO: A hack for now in order to force it as a MultiSelector.
         CollectSingleSelectorVisitor visitor = rule.Accept(new CollectSingleSelectorVisitor());
         ForEachIn(visitor.SelectorPath, alias);
     }
     catch (InvalidOperationException ex)
     {
         throw new InvalidOperationException("A self referencing rule (It) can only be used when a single field is used in the When clause.", ex);
     }
 }