コード例 #1
0
ファイル: Application_Start.cs プロジェクト: techieshop/RP
        public static void Initialize()
        {
            DependencyResolverConfig.RegisterType(new WebTypeResolver());

            DependencyResolver.SetResolver(new UnityDependencyResolver(DependencyResolverConfig.Container));

            RouteConfig.RegisterRoute(new DefaultRouteResolver());
            FilterConfig.RegisterFilter(new DefaultFilterResolver());
            BundleConfig.RegisterBundle(new DefaultBundleResolver());
            MappingConfig.RegisterMapping(new DefaultProfile());

            DataAnnotationsModelValidatorProvider.AddImplicitRequiredAttributeForValueTypes = false;

            foreach (ModelValidatorProvider provider in ModelValidatorProviders.Providers)
            {
                if (provider is ClientDataTypeModelValidatorProvider)
                {
                    ModelValidatorProviders.Providers.Remove(provider);
                    break;
                }
            }

            ModelMetadataProviders.Current = new RPModelMetadataProvider();

            ModelBinders.Binders.Add(typeof(double), new DoubleModelBinder());
            ModelBinders.Binders.Add(typeof(ICollection <int>), new IntCollectionModelBinder());
            ModelBinders.Binders.Add(typeof(KeyValuePair <,>), new KeyValuePairModelBinder());
        }
コード例 #2
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     FilterConfig.RegisterFilter(GlobalFilters.Filters);
     //×¢²áiocÈÝÆ÷
     AutofacConfig.RegisterIoc();
     AutoMapperConfig.RegisterProfile();
 }