Skip to content

Instantly share code, notes, and snippets.

@cmatskas
Created May 20, 2015 08:08
Show Gist options
  • Save cmatskas/44606c96b6ee24ea25ba to your computer and use it in GitHub Desktop.
Save cmatskas/44606c96b6ee24ea25ba to your computer and use it in GitHub Desktop.
//1. Application start up
protected void Application_Start()
{
// other code ommitted
DbInterception.Add(new YourInterceptor());
}
//2. DbConfiguration
public class YourDBContextConfiguration : DbConfiguration
{
public YourContextDbConfiguration()
{
DbInterception.Add(new YourInterceptor());
}
}
//3. Anywhere in your code, just call
DbInterception.Add(new YourInterceptor());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment