Example #1
0
 protected void Application_Start()
 {
     GlobalConfiguration.Configure(WebApiConfig.Register);
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     IoCConfig.Configure();
 }
Example #2
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

#if (!DEBUG)
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += ApplicationOnThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
#endif

            AutoMapperConfig.Execute();
            MetadataTypesRegister.InstallForThisAssembly();
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;

            using (var kernel = new StandardKernel())
            {
                //Configurar bindings
                IoCConfig.Configure(kernel);

                //Set global container.
                Ioc.Container = new NinjectIocContainer(kernel);

                //Config log4net
                //log4net.Config.DOMConfigurator.Configure();

                //MessageBoxDisplayService = Ioc.Container.Get<IMessageBoxDisplayService>();

                //Create a custom principal with an anonymous identity at startup
                //var laPazPrincipal = new LaPazPrincipal();
                //AppDomain.CurrentDomain.SetThreadPrincipal(laPazPrincipal);

                //#if(MOCK_SECURITY)
                //                MockUser();
                //#else
                //                using (var login = kernel.Get<FrmCreateMeasureWizard>())
                //                {
                //                    var result = login.ShowDialog();

                //                    if (result == DialogResult.Cancel)
                //                    {
                //                        Application.Exit();
                //                        return;
                //                    }
                //                }
                //#endif
                //var mainForm = kernel.Get<FrmPrincipal>();

                //Application.Run(mainForm);
            }
        }
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //Seeds the DB with initialized data
            Initializer dbInitializer = new Initializer();

            Database.SetInitializer(dbInitializer);

            //IoC container
            IoCConfig.Configure();
        }
Example #4
0
        public static void Register(HttpConfiguration config)
        {
            //var cors = new EnableCorsAttribute("*", "*", "*");
            //config.EnableCors(cors);

            MediaTypeFormattingConfig.Configure(config);
            RoutingConfig.Configure(config);
            IoCConfig.Configure(config);
            TracingConfig.Configure(config, IoCConfig.Container);
            LoggingConfig.Configure();
            ExceptionHandlingConfig.Configure(config);
            ValidationConfig.Configure(config);
            LocalizationConfig.Configure(config);

            //configure authentication
            config.MessageHandlers.Insert(0, new AuthenticationHandler());

            //for gzip compression use:
            // config.MessageHandlers.Insert(0, new ServerCompressionHandler(new GZipCompressor(), new DeflateCompressor()));
        }
Example #5
0
 protected void Application_Start()
 {
     GlobalConfiguration.Configure(WebApiConfig.Register);
     IoCConfig.Configure();
 }
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     IoCConfig.Configure();
 }