title: return tuple with two arrays
body: <p>I am trying to call a function which returns a tuple with two arrays. The content of the arrays are based on checked items in a checkedListBox.
  I define the arrays and call the function "storeParametersInArrays" as shown below.</p>
  
  <pre class="lang-cs prettyprint-override"><code>string[] allowedObjects = new string[checkedListObjects.CheckedItems.Count]; // All allowed objects
  string[] notallowedObjects = new string[checkedListObjects.Items.Count - checkedListObjects.CheckedItems.Count]; // All not allowed objects
  
  Tuple&lt;string[], string[]&gt; ObjParameters = storeParametersInArrays(notallowedObjects, allowedObjects, checkedListObjects);
  allowedObjects = ObjParameters.Item1;
  notallowedObjects = ObjParameters.Item2;
  </code></pre>
  
  <p>The function called is defined as:</p>
  
  <pre class="lang-cs prettyprint-override"><code>private Tuple&lt;string[], string[]&gt; storeParametersInArrays(string[] notallowed, string[] allowed, CheckedListBox checkedListBox)
  {
      int i = 0; // allowed objects
      int j = 0; // not allowed objects
      int k = 0; // item counter
  
      foreach (object item in checkedListBox.Items)
      {
          if (!checkedListBox.CheckedItems.Contains(item))
          {
              notallowed[j++] = checkedListBox.Items[k].ToString();
          }
          else
          {
              allowed[i++] = checkedListBox.Items[k].ToString();
          }
          k++;
      }
      return Tuple.Create&lt;allowed, notallowed&gt;;
  }
  </code></pre>
  
  <p>I am unable to return the Tuple in the above code sample. I get the error "Cannot convert method group 'Create' to non-delegate type 'Tuple'".</p>
  
  <p>It is my first time working with tuples, how can I return the two arrays without having to call the function twice?</p>
  
  <p>I have looked at slightly similar problems, so if the question is already answered somewhere else, I will be glad to be pointed in the right direction.</p>