ASP.NET Core API: How to Perform a Partial Update using HTTP PATCH Verb

preview_player
Показать описание
Firstly, we run through all the different CRUD operations and their relevant verbs for developing API integration.

Thereafter, we go ahead and identity the difference between a full update (HTTP PUT verb) and a partial update (HTTP PATCH verb). We explain a situation where doing a full update might not be a good idea.

We have created an ASP.NET Core MVC API application to test out the PATCH verb. We go through the code, run the application and then test the method in Postman.

Finally, we discuss that this method will reduce the risk of overwriting data and talk about ways where you can eliminate it.

📖 Learn .NET and C# with our online courses 📖

#aspnetcore #webapi #httppatch
Рекомендации по теме
Комментарии
Автор

Thanks for this! It helped me tremendously. Interestingly, I only had to pass the entity argument to the ApplyTo method. Not sure why, but it works.

medic
Автор

Very good video it is well explained and it reach his objective, I only have a question, if exists a method that only pass in the json the fields that you want to update like a partial object in typescript or a subset of full entity object.
{
Field1: new value,
Field2: new value
}

spartanzarazua
Автор

Hi, I have created a Request View Model in .net core API where 5 fields exist. I have also added Data annotations for those fields.
I want to have the flexibility for partial updates. So, if I want send json document of only one field to my api, how can allow partial update along with Data annotations also trigger on it.

shubhamdhanetia
Автор

Hi Round the Code .. you forgot to blink your Eyes...

bunnyworld
Автор

What do you think of using OData deltas?

flygonfiasco
visit shbcf.ru