Skip to content

Instantly share code, notes, and snippets.

@newdigate
Last active November 21, 2015 11:53
Show Gist options
  • Save newdigate/f955290b891d16f0ca38 to your computer and use it in GitHub Desktop.
Save newdigate/f955290b891d16f0ca38 to your computer and use it in GitHub Desktop.
Entity Framework not disposing DbContext correctly. #entity-framework
var lifetime = new PerRequestLifetimeManager();
container.RegisterType<DbContext, EntitiesDbContext>(lifetime);
Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment