/// <summary> /// Load your modules or register your services here! /// </summary> /// <param name="kernel">The kernel.</param> private static void RegisterServices(IKernel kernel) { var containerConfigurator = new NinjectConfigurator(); containerConfigurator.Configure(kernel); //Modules kernel.Load(new RepositoryModule()); kernel.Load(new BusinessServiceModule()); //Handlers GlobalConfiguration.Configuration.MessageHandlers.Add(kernel.Get<OptionsHandler>()); GlobalConfiguration.Configuration.MessageHandlers.Add(kernel.Get<SessionTokenAuthenticationMessageHandler>()); //Filters //GlobalConfiguration.Configuration.Filters.Add(kernel.Get<LoggingFilterAttribute>()); //GlobalConfiguration.Configuration.Filters.Add(kernel.Get<GlobalExceptionAttribute>()); GlobalConfiguration.Configuration.Filters.Add(new AuthorizeAttribute()); }
/// <summary> /// Load your modules or register your services here! /// </summary> /// <param name="kernel">The kernel.</param> private static void RegisterServices(IKernel kernel) { var containerConfigurator = new NinjectConfigurator(); containerConfigurator.Configure(kernel); //Modules kernel.Load(new RepositoryModule()); kernel.Load(new BusinessServiceModule()); //Handlers GlobalConfiguration.Configuration.MessageHandlers.Add(kernel.Get <OptionsHandler>()); GlobalConfiguration.Configuration.MessageHandlers.Add(kernel.Get <SessionTokenAuthenticationMessageHandler>()); //Filters //GlobalConfiguration.Configuration.Filters.Add(kernel.Get<LoggingFilterAttribute>()); //GlobalConfiguration.Configuration.Filters.Add(kernel.Get<GlobalExceptionAttribute>()); GlobalConfiguration.Configuration.Filters.Add(new AuthorizeAttribute()); }