예제 #1
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     UnityContainer unityContainer = new UnityContainer();
     unityContainer.RegisterType<IEmployeeRepository, EmployeeRepository>();
     UnityControllerFactory controllerFactory =new UnityControllerFactory(unityContainer);
     ControllerBuilder.Current.SetControllerFactory(controllerFactory);
 }
예제 #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            UnityContainer unityContainer = new UnityContainer();

            unityContainer.RegisterType <IEmployeeRepository, EmployeeRepository>();
            UnityControllerFactory controllerFactory = new UnityControllerFactory(unityContainer);

            ControllerBuilder.Current.SetControllerFactory(controllerFactory);
        }