I have a distributed database that I thought might be nice to have events fire on updates so that all users get their data updated immediately and found this nice article; EF Ev
If your CertsModelContainer is a DbContext, you can cast it to an IObjectContextAdapter in order to access the ObjectStateManager.
For example:
using (CertsModelContainer db = new CertsModelContainer())
{
((IObjectContextAdapter)db).ObjectStateManager.ObjectStateManagerChanged += (sender, e) =>
{
Console.WriteLine(string.Format(
"ObjectStateManager.ObjectStateManagerChanged | Action: {0}, Object: {1}",
e.Action,
e.Element));
};
}
Is CertsModelContainer a DbContext or an ObjectContext? Only the latter has an ObjectStateManager.
If you are using transactions you could use Transaction.TransactionCompleted