I would like to save the changes made to an object's properties that is saved in the DB through Entity Framework so that the id-s do not change only the properties. I tried removing it and adding it again but I get the following error: System.InvalidOperationException: 'The object cannot be deleted because it was not found in the ObjectStateManager.' I tried to set the Entity's state to modified but I get an error saying the id-s conflict with another db item (the one I want to modify, I want it to stay the same). I have not seen any modification done before so I have no idea how to do it.
Thanks for the advice
_yourContext.SaveChanges()
).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.