I know, I know. Why would anyone want to do that? The application already audits changes to data but now the business wants to audit all reads as well (without a convincing user story, I have to say). I have given them all the arguments against, but they insist.
So does EF/DbContext provide an extension point that would be suitable for intercepting all records returned from the database and writing an entry in an audit trail? Or is there another sensible way of doing this?
You could use the ObjectContext.ObjectMaterialized. MSDN snippet:
But this would only track items read from Db through your EF implementation.