title: Sending data in key, value pair to api
body: <p>I have my api method as below:</p>
  
  <pre><code>[HttpPost()]
  public async Task SaveDataAsync([FromBody] UserData value)
  {
       //saving logic here
  }
  </code></pre>
  
  <p>Where my UserData is defined as below:  </p>
  
  <pre><code>public class UserData
  {
     public string Conditions { get; set; }
     public DateTime Status { get; set; }
     public Dictionary&lt;string, Guid&gt; userSelections { get; set; } = new Dictionary&lt;string, Guid&gt;();   
  }
  </code></pre>
  
  <p>How can I send above Dictionary object from my UI.</p>
  
  <p>In my angular UI, user can select multiple data (represented in a table) and call this method to save the data.</p>
  
  <p>I can send some of the data as required, but I am not sure how can I send my object in key, value pair as required above.</p>
  
  <p>So after selection my object (userSelections as represented in my c# object) is as below:</p>
  
  <pre><code>0: Name: "Pete", Status: "open", id="af9f9937-f51a-4fd8-b29c-f9ef899684c9"
  1: Name: "Smith", Status: "closed", id="vfdf9337-f51s-wfd8-b49-f5ef799h84c9"
  2: Name: "Ang", Status: "open", id="334dd33-d3e3-cxc333-e3c-ccdc3cd32"
  </code></pre>
  
  <p>How can I create key value pair of name and id from above and send it to my api</p>
  
  <p>Below is my call to the api from angular</p>
  
  <pre><code>//this holds above data
   const userSelectedData = []; 
  
   const userData = {
          'name': userName,
          'conditions': conditions,
          'userSelections': userSelectedData       
        };
  
        this.service.save(userData)
          .subscribe(
            (res) =&gt; {            
              //saved         
            });         
      }
  </code></pre>