title: Passing complex object to WebAPI from AngularJS
body: <p>I am trying to post a JavaScript item to a C# WebAPI call using AngularJS.  Below is what I am trying to do.</p>
  
  <p>Objects</p>
  
  <pre><code>class Address
  {
      public string Street { get; set; }
      public string City { get; set; }
      public string State { get; set; }
  }
  class Person
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public Address address { get; set; }
  }
  </code></pre>
  
  <p>My C# Controller function </p>
  
  <pre><code>    [Route("Update/")]
      public void Update(Person person)
      {
          _service.Update(person);
      }
  </code></pre>
  
  <p>AngularJS call</p>
  
  <pre><code>    this.update = function (person) {
          $http.post("api/Person/Update/", person);
      }
  </code></pre>
  
  <p>When I receive the object in the WebAPI controller the address is null.  Why is this data not being received?</p>
  
  <p><strong>Edit</strong>
  I was wrong in my original question the Person object looked like this</p>
  
  <pre><code>class Person
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public IAddress address { get; set; }
  }
  </code></pre>
  
  <p>When I changed address from IAddress to Address everything worked as expected.</p>