I am PATCHing JSON from the client to my Web API 2 controller.
The request looks like:
Request URL: http://localhost:28029/PlaylistItem/5df2b99f-e021-4c81-8ff5-a34c013470aa
Request Payload: { sequence: 5000 }
My controller's method looks like:
[Route("{id:guid}")]
[HttpPatch]
public void Patch(Guid id, Delta<PlaylistItemDto> playlistItemDto)
{
}
Where PlaylistItemDto looks like:
public class PlaylistItemDto
{
public Guid PlaylistId { get; set; }
public Guid Id { get; set; }
public int Sequence { get; set; }
...
}
This successfully sends a request to the controller, but fails to work properly because of case-sensitivity. The OData library does not properly translate sequence into Sequence.
I found one thread regarding the issue, asp.net mvc web api partial update with OData Patch, but I found the solution to be lackluster. Is there no current working solution for this issue? Case-sensitivity would seem to be a very common use case for PATCHing JSON data from a client to a server.