To perform operations before/after entities are written to the database, I can do so before/after .SaveChanges()
.
How about after entities are read ("materialized") from the database - is there an event, lifecycle hook, callback, or something that I can use?
I'm upgrading a 1.x project to 2.2 and I hope there's something new that allows me to do that.
From Microsoft documentation, since efcore 2.1 there is now a way to handle some events from ChangeTracker.
State change events
New Tracked And StateChanged events on ChangeTracker can be used to write logic that reacts to entities entering the DbContext or changing their state.
Maybe you can find what you want there.