title: Ajax call to action with a List of KeyValuePairs as parameter
body: <p>I wish to simply do an AJAX call to a method expecting a List of Key and value pairs, but I have no idea how to do this. I tried the following:</p>
  
  <p>Server method: </p>
  
  <pre><code>UpdateBranches(List&lt;KeyValuePair&lt;string, string&gt;&gt; brancheItems)
  </code></pre>
  
  <p>data to be send:</p>
  
  <pre><code> var brancheItems = [];
   businessActivities.forEach(f =&gt;   
       brancheItems.push({
        Key: f.sbiCode,
        Value: f.sbiCodeDescription
   })
  </code></pre>
  
  <p>This seemed to give me an array of objects with key and value properties. (network tab showed it), but it did not work. I also tried to make an array of objects with one property (propertyname is the key, value is the value):</p>
  
  <pre><code>for (var itemIndex in items[index].businessActivities) {
     var key = items[index].businessActivities[itemIndex].sbiCode;
     brancheItems.push({ 
  key: items[index].businessActivities[itemIndex].sbiCodeDescription
          });
      }
  </code></pre>
  
  <p>Note that on the server I seem to receive an array/list of 3 items with two properties, but the properties are always empty. Does anyone know the correct format for the data to be send</p>