protected void Application_Start() { //WebApiConfig.Register(GlobalConfiguration.Configuration); GlobalConfiguration.Configure(WebApiConfig.Register); RouteConfig.RegisterRoutes(RouteTable.Routes); //BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); var myScriptResDef = new ScriptResourceDefinition(); myScriptResDef.Path = "~/Scripts/jquery-2.0.3.min.js"; myScriptResDef.DebugPath = "~/Scripts/jquery-2.0.3.min.js"; ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef); var config = GlobalConfiguration.Configuration; config.Formatters.Insert(0, new JsonMediaTypeFormatter()); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); //HttpConfiguration.EnsureInitialized(); //config.Formatters.Remove(config.Formatters.XmlFormatter); /* * AreaRegistration.RegisterAllAreas(); * GlobalConfiguration.Configure(WebApiConfig.Register); * FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); * RouteConfig.RegisterRoutes(RouteTable.Routes); * BundleConfig.RegisterBundles(BundleTable.Bundles); * */ }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); var formatters = GlobalConfiguration.Configuration.Formatters; formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html")); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); BundleConfig.RegisterBundles(BundleTable.Bundles); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); RouteConfig.RegisterRoutes(RouteTable.Routes); DemoDataGenerator.Generate(HttpContext.Current.Server.MapPath("~/App_Data/SalesDashboardData.xml")); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); GlobalConfiguration.Configuration.MessageHandlers.Add(new CrossDomainHandler()); GlobalConfiguration.Configuration.Formatters.RemoveAt(1); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); // Disable the HTTP Header X-Frame-Options: SAMEORIGIN AntiForgeryConfig.SuppressXFrameOptionsHeader = true; //Enable JSONP FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); GlobalConfiguration.Configuration.MessageHandlers.Add(new AuthorizationHeaderHandler()); // Change the URL localization scheme from Scheme1. i18n.UrlLocalizer.UrlLocalizationScheme = i18n.UrlLocalizationScheme.Void; // Specifies a custom method called after a nugget has been translated // that allows the resulting message to be modified, for instance according to content type. i18n.LocalizedApplication.Current.TweakMessageTranslation = delegate(System.Web.HttpContextBase context, i18n.Helpers.Nugget nugget, i18n.LanguageTag langtag, string message) { switch (context.Response.ContentType) { case "text/html": return(message.Replace("\'", "'")); } return(message); }; // Blacklist certain URLs from being 'localized' via a callback. i18n.UrlLocalizer.IncomingUrlFilters += delegate(Uri url) { if (url.LocalPath.EndsWith("sitemap.xml", StringComparison.OrdinalIgnoreCase)) { return(false); } return(true); }; System.Timers.Timer rulesTimer = new System.Timers.Timer(RulesTimerIntervalInMilliseconds); rulesTimer.Enabled = true; rulesTimer.Elapsed += new ElapsedEventHandler(rulesTimer_Elapsed); rulesTimer.Start(); System.Timers.Timer offineTimer = new System.Timers.Timer(OfflineTimerIntervalInMilliseconds); offineTimer.Enabled = true; offineTimer.Elapsed += new ElapsedEventHandler(offlineTimer_Elapsed); offineTimer.Start(); }
protected void Application_Start() { var formatters = GlobalConfiguration.Configuration.Formatters; var jsonFormatter = formatters.JsonFormatter; var settings = jsonFormatter.SerializerSettings; settings.Formatting = Formatting.Indented; settings.ContractResolver = new CamelCasePropertyNamesContractResolver(); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); Slapper.AutoMapper.Configuration.IdentifierConventions.Add(type => type.Name + "_Id"); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings = new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = DateTimeZoneHandling.Local, }; GlobalData.InitSessionDictionary(); //GlobalConfiguration.Configuration.MessageHandlers.Add(new CorsHandler()); }
protected void Application_Start() { //AreaRegistration.RegisterAllAreas(); //GlobalConfiguration.Configure(WebApiConfig.Register); //FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); //RouteConfig.RegisterRoutes(RouteTable.Routes); //Http Client Protocol Settings System.Net.ServicePointManager.Expect100Continue = false; System.Net.ServicePointManager.MaxServicePointIdleTime = 60 * 60 * 1000;//60 Minutes ServicePointManager.DefaultConnectionLimit = 132; FileInfo fi = new FileInfo(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "\\web.config"); log4net.Config.XmlConfigurator.ConfigureAndWatch(fi); Assembly assem = Assembly.GetExecutingAssembly(); AssemblyName assemName = assem.GetName(); AggieGlobalLogManager.Info("================================================================="); AggieGlobalLogManager.Info("Starting SKYSITE-Web-API-Service v{0}", assemName.Version); AggieGlobalLogManager.Info("================================================================="); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); FilterConfig.RegisterHttpFilters(GlobalConfiguration.Configuration.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); HandlerConfig.RegisterHandlers(GlobalConfiguration.Configuration.MessageHandlers); //Instnatiate the one & only instance of GlobalApp - facade design pattern to Provide an unified interface to a set of interfaces to deal with business functions if (_theGlobalApp == null) { string dbConnectionStringName = "AggieGlobalDB"; GlobalApp.Initialize(dbConnectionStringName); _theGlobalApp = GlobalApp.Instance; } }
protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters); }