Ejemplo n.º 1
1
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            GlobalFilters.Filters.Add(new AuthorizeAttribute());
            GlobalFilters.Filters.Add(new CultureAttribute());

            DataAnnotationsModelValidatorProvider.AddImplicitRequiredAttributeForValueTypes = false;

            var kernel = new Bootstrapper().Kernel;
            kernel.Inject(Membership.Provider);
            kernel.Inject(Roles.Provider);
        }
Ejemplo n.º 2
0
        private static INiceUrlRepository CreateRepository()
        {
            var bootStrapper = new Bootstrapper();
            var kernel = bootStrapper.Kernel;

            return ((IRepositoryFactory<INiceUrlRepository>)kernel.GetService(typeof(IRepositoryFactory<INiceUrlRepository>))).Repository;
        }
Ejemplo n.º 3
0
 private void RegisterDependencyResolver()
 {
     var kernel = new Bootstrapper().Kernel;
     DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel));
 }