ASP.Net Core Web API - Partial Update using HTTP PATCH

preview_player
Показать описание
We are going to concentrate on when you update, should you do a full update or a partial update?
Picture this scenario. You work for a video game shop. The publishers of a game have officially announced the title of a popular game. You load up the video game record onto your system, which includes the title, publisher and release date.
Picture this scenario. You work for a video game shop. The publishers of a game have officially announced the title of a popular game. You load up the video game record onto your system, which includes the title, publisher and release date.
You have finally found the official title of the game, and go ahead and make the change. But wait! There is a problem. Because you haven't reloaded the record, the release date displayed is the date before the spreadsheet was imported.
In this scenario, if you do a full update, it will revert the release date back to it's original value and will hold the incorrect release date.
However, you could do a partial update, only updating the fields that have changed. In this instance, because we have only changed the title of the video game, it will only update the title. All other fields will be left alone.

http-patch-request-asp-net-web api
Рекомендации по теме