How to know which fields of a record are updated in saving the edit? [closed]
- by Luiz Maffort
I'm recording in a log table all that is changed in a given table, so this need to know when for example the User to change the status from active to inactive.
With this information I will write in my log table information of which record was changed, by whom and what was the value of old and new.
If I instantiate an object before:
db.Entry(chamados).State = EntityState.Modified;
I can even compare, but this error appears at runtime.
*An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key.
*
Podem me ajudar por favor?