title: Angular send complex object to C# Controller
body: <p>I've got a service that I use to send requests to an MVC controller in C#.</p>
  
  <p>This has been working fine until now that I have a complex object I'm trying to send.  The param <code>postDto</code> in C# is always null. I've tried a few different solutions but haven't been able to solve this issue.  If I remove the list from the object, the object comes across successfully. Any help would be appreciated.</p>
  
  <p><strong>service.ts</strong></p>
  
  <pre><code>...
  post$(postDto: MyTSPostDto): Observable&lt;MyTSDto&gt; {
      return this.http.post&lt;MyTSDto&gt;(
          location.origin + '/api/mycontroller',
          postDto,
          { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) }
      ).pipe(
          map((response: MyTSDto) =&gt; response)
      );
  }
  </code></pre>
  
  <p><strong>myTSPostDto.ts</strong></p>
  
  <pre><code>export class MyTSPostDto {
      firstPostDto: FirstPostDto;
      secondPostDto: SecondPostDto;
      thirdPostDtos: ThirdPostDto[] = [];
  }
  </code></pre>
  
  <p><strong>postDto.cs</strong></p>
  
  <pre><code>public class PostDto
  {
      public FirstPostDto FirstPostDto { get; set; }
      public SecondPostDto SecondPostDto { get; set; }
      public List&lt;ThirdPostDto&gt; ThirdPostDtos { get; set; }
  }
  </code></pre>
  
  <p><strong>MyController.cs</strong></p>
  
  <pre><code>...
  [HttpPost]
  [ProducesResponseType(typeof(MyDto), 200)]
  public async Task&lt;IActionResult&gt; Migrate([FromBody] PostDto postDto)
  {
  ...
  </code></pre>