mardi 23 décembre 2014

Adding code to Entity Framework 6 model that runs whenever a new model context is instantiated

I'm using EF6 and the latest build of the SQLite EF6 provider. There's a PRAGMA statement that I need to be executed whenever a new model context is instantiated and the connection opened.


Does EF6 have some mechanism that allows me to do this? Or am I going to be modifying my code everywhere that the model is used to check the PRAGMA and set it to the desired value? Note that there is no connection string property that corresponds to this PRAGMA or I'd do it there.


Aucun commentaire:

Enregistrer un commentaire