Reputation: 165
I am currently using ASP.NET MVC to create a web app. I am also using the JsonPatch library to update the database in my app.
Currently I have a situation where my method seems to get incoming data correctly and the JsonPatch HTTP response return a status 200. But my database table is not updated at all.
The value to update is "BCL", is correct, but once it finishes this method, the database table is not updated at all.
The code which calls the above method is shown below:
The http request returns a status code of 200 also. So I suppose the patch operation should be successful.
I am wonder if the version of JsonPatch that I am using makes a difference?
Thank you for the help.
Upvotes: 0
Views: 496
Reputation: 4246
I believe you need to update the code as following:
InvPatchDocument.ApplyUpdatesTo(currentInv);
db.Update(cuurentInv);
db.SaveChanges();
Added db.Update(currentInv)
Upvotes: 1