From reading the RFC specification of the Patch verb it's clear that the Patch
verb shouldn't get values to partially update the entity but operations to make:
...With PATCH, however, the enclosed entity contains a set of instructions describing how a resource currently residing on the origin server should be modified to produce a new version.
In MSDN for the Delta class it's also clear, as the Patch description says:
Overwrites the original entity with the changes tracked by this Delta.
Unlike the description of Put:
Overwrites the original entity with the values stored in this Delta.
So far so good, but I couldn't find a way to send those "instructions" with OData, No matter what I do, Delta.Patch only replaces the values.
What should be the syntax of Patch request?
The ways I tried were:
PATCH http://localhost:55783/Products(1) HTTP/1.1
User-Agent: Fiddler
Host: localhost:55783
Content-Length: 19
Content-type: application/json
{ "Price": 432 }
And
{ "op": "add", "path": "/Price", "value": 423432 }
And stuff near that.
Update:
Thanks to Michael Moore and from reading the whole Delta class with ILSpy I think it's indeed a bug in the Patch verb design.
I opened a bug for Microsoft, you can vote on it if you need it to be fixed too.