title: Is this a proper way of defining a rule in NRules?
body: <pre><code>public class AllowAtleastOneCountryRule : Rule
  {
      public override void Define()
      {
          Profile profile = null;
  
          string str = @"At least one country has to be defined as 'permitted'";
  
  
          bool enabled = AllRules.GetDict()[str];//Checks if the rule is enabled
  
  
          When()
              .Match&lt;FundProfile&gt;(() =&gt; productProfile)
              .Exists&lt;FundProfile&gt;(p =&gt; enabled, p =&gt; RuleViolation(p));
  
  
          Then()
              .Do(_ =&gt; profile .DisplayError(str));
  
  
      }
  
  
      bool RuleViolation(FundProfile pp)
      {
          try
          {
  
  
              if (pp.DefaultMode.Equals(Helper.DefaultModes.Allow.ToString()))
              {
                  if (pp.ListOfCountries.Count &lt; pp.TotalCountries)//Okay
                      return false;
                  else//Rule violation
                      return true;
              }
              else//Deny
              {
                  if (pp.ListOfCountries.Count &gt; 0)//Okay
                      return false;
                  else//Rule violation
                      return true;
              }
  
          }
          catch(Exception e)
          {
              throw new InvalidRuleException(e.Message);
          }
  
      }
  }
  </code></pre>
  
  <p>As you can see I am calling another method with the rule to evaluate few conditions. I feel like I am not using the full functionality of Rete algorithm here as I am pre-evaluating things for my self.
  Can anyone guide me on how to approach this?</p>