Esempio n. 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);
 }
Esempio n. 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);
        }