Ejemplo n.º 1
0
        /// <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());
        }
Ejemplo n.º 2
0
        /// <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());
        }