コード例 #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            var formatters    = GlobalConfiguration.Configuration.Formatters;
            var jsonFormatter = formatters.JsonFormatter;
            var settings      = jsonFormatter.SerializerSettings;

            jsonFormatter.UseDataContractJsonSerializer = false;
            settings.Converters.Add(new IsoDateTimeConverter());
            settings.Formatting = Formatting.Indented;

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            GlobalConfiguration.Configuration.Formatters.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);
            GlobalConfiguration.Configuration.Formatters.Add(jsonFormatter);
            //GlobalConfiguration.Configuration.Formatters.JsonFormatter.UseDataContractJsonSerializer = false;
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();

            ContainerSetup.BootstrapContainer();

            GestorAplicacion.IniciarAplicacion();
        }
コード例 #2
0
 protected void Application_End()
 {
     GestorAplicacion.FinalizarAplicacion();
     ContainerSetup.TeardownContainer();
 }