I have some code which encrypts and decrypts data using EF POCO. To implement this I intercepted the Saving Changes and ObjectMaterialized events and it works (most of the time).
The issue I have is if I try to read back the encrypted object straight after saving the object the materialized event does'nt fire as it not going back to the DB to retrieve the record and therefore fails to fire the event.
Does anyone have any thoughts on how I could improve my approach to cover off this situation ?