0

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.

Below are my screenshots: enter image description here

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: enter image description here

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.

JC6T
  • 135
  • 4
  • 13

1 Answers1

1

I believe you need to update the code as following:

InvPatchDocument.ApplyUpdatesTo(currentInv);
db.Update(cuurentInv);
db.SaveChanges();

Added db.Update(currentInv)

Mohsin Mehmood
  • 4,156
  • 2
  • 12
  • 18