I have write patch in WEB API now i want to consume that in UI how to write code for that one could you please send it that code both code of controller and View
How to consume patch
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Naimish MakwanaRank #324 · 7.7K reputationPosted Mar 1, 2023, 11:06 PM EST
Hello Latha,
PATCH method in your WEB API controller that updates an existing resource based on the provided input
[HttpPatch("{id}")] public async Task UpdateResource(int id, [FromBody] ResourceModel updatedResource) { // Your code for updating the resource with the provided input goes here return Ok(updatedResource); }To consume the PATCH method in the UI and display the updated resource in the view, using Jquery
var resource = { id: 1, name: "Name", description: "description" // Add any additional properties you want to update here }; $.ajax({ url: "/api/resource/" + resource.id, type: "PATCH", contentType: "application/json", data: JSON.stringify(resource), success: function(data) { // Update the view with the updated resource data // Update any additional properties you want to display here } });You can refere below links for using in UI
https://stackoverflow.com/a/49905148/3054222
Also full example with all the request.
https://www.yogihosting.com/aspnet-core-consume-api-jquery/
Thanks
Naimish Makwana