There are certain cases for values that should always be updated when an object is persisted to the database. I can find no entry point for doing this other than overriding DbContext.ValidateEntity and modifying the CurrentValues property collection, but in my opinion using a validation method to modify object properties carries a very bad smell. Is there any other means of doing this?
There are certain cases for values that should always be updated when an object
Share
Thanks to Eranga‘s comment above, I found this answer is a perfect fit for my question.
It describes how to override
SaveChangeson my dbcontext and set the properties I would like to there.