コード例 #1
0
ファイル: Global.asax.cs プロジェクト: nlh774/MVC5-Scaffolder
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        
            //BundleTable.EnableOptimizations = false; 
            //ModelBinders.Binders.DefaultBinder = new EnumModelBinder();







        }
コード例 #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // IOC - AutoFac
            new Bootstrapper().RegisterIOC();

            // Configure AutoMapper
            AutoMapperConfig.RegisterMappings();

            // ignora self reference (loop that causes some issues)
            GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;

            // remove a formatação XML da exportação WebApi (fica jSon como default)
            GlobalConfiguration.Configuration.Formatters.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);
        }