示例#1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            NinjectModule registrations = new NinjectRegistrations();
            var           kernel        = new StandardKernel(registrations);

            BLLNinjectBinder.Init(kernel, "CallCenterDb");
            DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel));
        }
 /// <summary>
 /// Load your modules or register your services here!
 /// </summary>
 /// <param name="kernel">The kernel.</param>
 private static void RegisterServices(IKernel kernel)
 {
     BLLNinjectBinder.Init(kernel, ConfigurationManager.ConnectionStrings["CinemaDb"].ToString());
     kernel.Bind <IMovieService>().To <MovieService>().InRequestScope();
 }