title: Splitting array of objects and then process it in batches
body: <p>What would be a good way to call the <code>Execute</code> method in batches of <code>rulesObjs</code>? Lets say the list have more than 10,000 objects and I want to call <code>Execute</code> with no more than 500 at a time.</p>
  
  <pre><code>    public static List&lt;object&gt; ExecutePolicy()
      {
          Policy policy = new Policy();
  
          List&lt;object&gt; rules = GetRules();
  
          object[] rulesObjs = rules.ToArray();
  
          // Call this method with array of object, but in batches.
          policy.Execute(rulesObjs);
  
          return rulesObjs.ToList();
      }
  
      private static List&lt;object&gt; GetRules()
      {
          // get the rules via some process
          return new List&lt;object&gt;();
      }
  }
  
  public sealed class Policy
  {
      public void Execute(params object[] rules)
      {
          // Process rules...
      }
  }
  </code></pre>
  
  <p>I do not have control over <code>Execute()</code> method.</p>