protected void Application_Start() { AreaRegistration.RegisterAllAreas(); HostingEnvironment.RegisterVirtualPathProvider(new GriffinVirtualPathProvider()); //ViewEngines.Engines.Insert(0, new MyViewEngine()); ControllerBuilder.Current.DefaultNamespaces.Add("Griffin.MvcContrib.Areas.Controller"); //ControllerBuilder.Current.SetControllerFactory(new MyControllerFactory()); var stringProvider = new ResourceStringProvider(LocalizedStrings.ResourceManager); ModelMetadataProviders.Current = new LocalizedModelMetadataProvider(stringProvider); ModelValidatorProviders.Providers.Clear(); ModelValidatorProviders.Providers.Add(new LocalizedModelValidatorProvider(stringProvider)); ViewLocalizer.Current.DefaultCulture = new CultureInfo(1053); var builder = new ContainerBuilder(); builder.RegisterControllers(Assembly.GetExecutingAssembly()); builder.RegisterType<ViewLocalizationFileRepository>().AsImplementedInterfaces(); builder.RegisterType<CustomControllerActivator>().AsImplementedInterfaces().SingleInstance(); _container = builder.Build(); DependencyResolver.SetResolver(new AutofacDependencyResolver(_container)); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); var stringProvider = new ResourceStringProvider(LocalizedStrings.ResourceManager); ModelMetadataProviders.Current = new LocalizedModelMetadataProvider(stringProvider); ModelValidatorProviders.Providers.Clear(); ModelValidatorProviders.Providers.Add(new LocalizedModelValidatorProvider(stringProvider)); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); }