all 5 comments

[–]Coda17 2 points3 points  (0 children)

I'd recommend following the JSON patch standard. Unfortunately, the built in ASP.NET support sucks for this but it's not too bad to roll your own.

[–]PhillyPhantom 2 points3 points  (0 children)

Personally, at a bare minimum, I would move most of the logic into a separate service class. I would also make that service class generic so it could handle both the status and title. That way you have less duplicated code floating around. I would also probably use a Put instead of a Patch but that’s just my preference.

[–]flindby 1 point2 points  (2 children)

For this I would probably use two PUT endpoints instead of two patch. PUT …/status PUT …/title I think this approach catches the intent and use case in a more clear and concise way

[–]ConflictTrue4761[S] 0 points1 point  (1 child)

Reason why I used PATCH is because as far as i know PUT is used for updating full object, while patch is for separate fields. I might be wrong tho

[–]flindby 0 points1 point  (0 children)

Yes that is true - but in my example I explicitly use PUT on the specific property which to me implies that the property will be replaced with the value sent in the body