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); }
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); }