Permalink
Browse files

Fixing Ninject bindings

  • Loading branch information...
1 parent 7062ca0 commit 65a900137a2cc8bc785697735a66054be14f3c20 @jchadwick jchadwick committed Dec 21, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 Website/App_Start/NinjectMVC3.cs
@@ -55,7 +55,11 @@ public class BindingsModule : Ninject.Modules.NinjectModule
{
public override void Load()
{
- Bind<IRepository>().To<Repository>();
+ Bind<DataContext>().ToSelf().InRequestScope()
+ .OnDeactivation(x => x.SaveChanges());
+
+ Bind<IRepository>().To<Repository>()
+ .WithConstructorArgument("isSharedContext", true);
}
}
}

0 comments on commit 65a9001

Please sign in to comment.