Hi there,
We are using this package in EF6 and it's working well, but running into trouble with where to register hooks exactly.
The logical place is in the constructor of the DbContext, but that can run into trouble as the very first time you construct the DbContext, the model may not have been created yet. This is a problem for unit tests.
Registering in OnModelCreating doesn't work either though.
public class MyDbContext : DbContext { public MyDbContext() { this.OnSave().Attach(new MyHook()); // Fails the first time the context is constructed, as model has not been created yet. } }
Wondering what strategy you take for registering the hooks.
Cheers