Example #1
0
        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;
            }
        }