title: How to pass two filled class models via an Angular http.post 'body' to the controller?
body: <p>I am receiving an error message, "Sequence contains no elements" while trying to update a table in SQL from Angular 7 to an AspNet Core controller by passing two model parameters using an "http.post". </p>
  
  <p>I am passing the data from the form to the class models with no problem because I can see the payload data in the browser console. However, when trying to pass the models as parameters in my api service to the controller, all of the parameters in the model are null. I usually don't have an issue when passing one model parm thru, but passing two of them to get to my controller with a [FromBody] doesn't seem to want to work for me.</p>
  
  <p>I tried to wrap the models in curly brackets to pass them, to no avail:</p>
  
  <pre><code>UpdateService(serviceAddress: ServiceAddressModel, contact: ContactModel) {
  let reqHeader = new HttpHeaders();
  let body = { svc: serviceAddress, cnt: contact };
  reqHeader.append('Content-Type', 'application/json');
  return this.http.post(this.baseurl + 'api/customermanagement/update-service-address-info', body, { headers: reqHeader });
  </code></pre>
  
  <p>When I view the request / response in the browser console, I can see the data within the payload, so I know that the data is ready to pass.</p>
  
  <p>My controller is set up as follows:</p>
  
  <pre><code>       [Route("update-service-address-info")]
      public bool UpdateServiceAddressAccount([FromBody] ServiceAddressEntity svc_id, [FromBody] ContactEntity cnt_id)
      {
          return serviceAddressService.UpdateServiceAddressAccount(svc_id, cnt_id);
      }
  </code></pre>
  
  <p>Using breakpoints in this call shows null for all values.</p>
  
  <p>If I can properly pass the parameters to my interface, I should be good-to-go. I am sensing that I am not structuring the parameters properly in the http.post body.</p>