Skip to content

Commit

Permalink
Add scope to bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
cwetanow committed Mar 27, 2017
1 parent e7f15d6 commit 7753916
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Logs.Web/App_Start/NinjectModules/AuthNinjectModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class AuthNinjectModule : NinjectModule
{
public override void Load()
{
this.Bind<IAuthenticationProvider>().To<AuthenticationProvider>();
this.Bind<IAuthenticationProvider>().To<AuthenticationProvider>().InSingletonScope();
}
}
}
11 changes: 6 additions & 5 deletions src/Logs.Web/App_Start/NinjectModules/ServiceNinjectModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
using Ninject;
using Ninject.Extensions.Interception.Infrastructure.Language;
using Ninject.Modules;
using Ninject.Web.Common;

namespace Logs.Web.App_Start.NinjectModules
{
public class ServiceNinjectModule : NinjectModule
{
public override void Load()
{
this.Bind<ILogService>().To<LogsService>();
this.Bind<IEntryService>().To<EntryService>();
this.Bind<IUserService>().To<UserService>();
this.Bind<IVoteService>().To<VoteService>();
this.Bind<ICommentService>().To<CommentService>();
this.Bind<ILogService>().To<LogsService>().InRequestScope();
this.Bind<IEntryService>().To<EntryService>().InRequestScope();
this.Bind<IUserService>().To<UserService>().InRequestScope();
this.Bind<IVoteService>().To<VoteService>().InRequestScope();
this.Bind<ICommentService>().To<CommentService>().InRequestScope();

this.Bind<CachingInterceptor>().ToSelf();

Expand Down

0 comments on commit 7753916

Please sign in to comment.