How to implement Partial Updates (PATCH) in Restful Web API (.NET/ JSON/ EF6) Server side

c# entity-framework-6 json patch rest

Question

The models (and corresponding tables) in the Web API project I've been working on are rather large, thus partial updates are an essential must.

I considered the POST option to a subset of the model, but I don't believe it is practical to expose that many URIs given the model's enormous number of fields (including custom fields).

I am aware that I can allow a client to perform partial updates using the PATCH verb, but I am having trouble visualising how to capture this on the server side and then determine what has changed (post JSON to model conversion) so that I can differentiate between which fields the client explicitly set as NULL (as she wanted to update field) and which are NULL as a result of no update.

Must I use a custom mapper? alternatively, ought to I make generic attributes and record state at the field level?

I've searched the internet and here on SOF.com (and I'm still searching), but I haven't found anything reputable or definitive. I'm asking experts for their opinions.

Thanks for your assistance!

1
1
10/11/2016 6:50:16 AM

Popular Answer

ZZZ_tmp
0
10/11/2016 7:06:13 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow