title: How to pass C# dictionary into typescript Map
body: <p>How can I pass correctly C# dictionary into typescript Map.</p>
  <pre><code>[HttpGet(&quot;reportsUsage&quot;)]
      public IActionResult GetReportsUsage()
      {
          //var reportsUsage = _statService.GetReportsUsage();
  
          IDictionary&lt;int, int&gt; test = new Dictionary&lt;int, int&gt;();
  
          test.Add(1, 20);
          test.Add(2, 30);
          test.Add(3, 40);
          test.Add(4, 50);
          test.Add(5, 70);
          test.Add(6, 60);
          test.Add(7, 90);
          test.Add(8, 30);
  
          return Ok(test);
          //return Ok(reportsUsage );
      }
  </code></pre>
  <p>In angular:</p>
  <pre><code>getReportsUsage() {
  return this.http.get&lt;Map&lt;number, number&gt;&gt;(`${environment.apiUrl}/stats/reportsUsage`, {
    headers: new HttpHeaders({
      'Content-Type': 'text/plain',
      'Accept': 'application/json'
    }),
    withCredentials: true
  });
  }
  
  reportsUsage = new Map&lt;number, number&gt;();
  
  this.statsService.getReportsUsage().subscribe(data =&gt; {
      this.reportsUsage = data;
      
      //1
      console.log(this.reportsUsage);
      //2
      console.log(this.reportsUsage.values());
      //3
      console.log(typeof(this.reportsUsage));
  };
  </code></pre>
  <p>Results:</p>
  <p>1</p>
  <blockquote>
  <p>{1: 20, 2: 30, 3: 40, 4: 50, 5: 70, 6: 60, 7: 90, 8: 30}</p>
  </blockquote>
  <p>2</p>
  <blockquote>
  <p>ERROR TypeError: this.reportsUsage.values is not a function</p>
  </blockquote>
  <p>3</p>
  <blockquote>
  <p>object</p>
  </blockquote>
  <p>So the data type change from Dictionary into object, I have tried to convert it with the below but still not working:</p>
  <pre><code>console.log(new Map(this.reportsUsage));
  </code></pre>
  <blockquote>
  <p>TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))</p>
  </blockquote>