title: ASP.NET oData patchValue received from Angular is nothing
body: <p>I'm developing an app with an Angular based front-end and an ASP.NET back end using oData and Oracle. I'm at the point where I'm trying to patch records on the back end. I'm using generic boilerplate code on the back end in my controller and the patch method looks like this:</p>
  
  <pre><code>  &lt;AcceptVerbs("PATCH", "MERGE")&gt;
      Async Function Patch(&lt;FromODataUri&gt; ByVal key As Decimal, ByVal patchValue As Delta(Of FTP_ORDERS)) As Task(Of IHttpActionResult)
          Validate(patchValue.GetEntity())
  
          If Not ModelState.IsValid Then
              Return BadRequest(ModelState)
          End If
  
          Dim fTP_ORDERS As FTP_ORDERS = Await db.FTP_ORDERS.FindAsync(key)
          If IsNothing(fTP_ORDERS) Then
              Return NotFound()
          End If
  
          patchValue.Patch(fTP_ORDERS)
  
          Try
              Await db.SaveChangesAsync()
          Catch ex As DbUpdateConcurrencyException
              If Not (FTP_ORDERSExists(key)) Then
                  Return NotFound()
              Else
                  Throw
              End If
          End Try
  
          Return Updated(fTP_ORDERS)
      End Function
  </code></pre>
  
  <p>On the Angular side, I'm using $resource based service to send the update. The code that calls the resource looks like this:</p>
  
  <pre><code> (new FTPOrderService({
                      "key": vm.ID,
                      "data": vm
                  }, vm))
                      .$patch()
                      .then(function (data) {
                          alert("Order Saved!");
                      },
                          function (error) {
                              debugger;
                          }
                          ); 
  </code></pre>
  
  <p>The service is defined with:</p>
  
  <pre><code>.factory('FTPOrderService', function ($resource) {
          var odataUrl = '../odata/FTP_ORDERS';
          var results = $resource('', {}, {
              'patch': {
                  method: 'PATCH',
                  params: {
                      key: '@key',
                  },
                  url: odataUrl + '(:key)'
              }
          });
  
          return results;
      })
  </code></pre>
  
  <p>I've also tried: </p>
  
  <pre><code>(new FTPOrderService({
                      "key": vm.ID,
                  }, vm))
                      .$patch(vm)
                      .then(function (data) {
                          alert("Order Saved!");
                      },
                          function (error) {
                              debugger;
                          }
                          ); 
  </code></pre>
  
  <p>and get the same results.</p>
  
  <p>I believe that I have configured angular to send the data properly with:</p>
  
  <pre><code>.config(['$httpProvider', function ($httpProvider) {
          $httpProvider.defaults.headers.patch = {
              'Content-Type': 'application/json;charset=utf-8'
          };
      }])
  </code></pre>
  
  <p>The debugger shows that I'm calling the URL with the appropriate key appended to it in parens and the request payload looks like this:</p>
  
  <pre><code>{key: "1239990990", data: {loading: false, selectedRow: {}, lineItems: [,…], orderId: "1239990990",…}}
  data: {loading: false, selectedRow: {}, lineItems: [,…], orderId: "1239990990",…}
  key: "1239990990"
  </code></pre>
  
  <p>Any idea of what I'm missing? There are numerous examples out there using direct calls to $http.post and a few for .patch, but nothing current using $resource. </p>