コード例 #1
0
        protected void Application_Start()
        {
            try
            {
                AreaRegistration.RegisterAllAreas();
                FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
                RouteConfig.RegisterRoutes(RouteTable.Routes);
                BundleConfig.RegisterBundles(BundleTable.Bundles);

                ScheduledTasksRegistry.Init();


                //Database.SetInitializer<SportsSystemDbContext>(null);
                Database.SetInitializer(new MigrateDatabaseToLatestVersion <SportsSystemDbContext, IAUNSportsSystem.DataLayer.Migrations.Configuration>());

                DbInterception.Add(new YeKeInterceptor());



                ViewEngines.Engines.Clear();
                ViewEngines.Engines.Add(new RazorViewEngine());

                MvcHandler.DisableMvcResponseHeader = true;
            }
            catch
            {
                HttpRuntime.UnloadAppDomain(); // سبب ری استارت برنامه و آغاز مجدد آن با درخواست بعدی می‌شود
                throw;
            }
        }
コード例 #2
0
        protected void Application_Start()
        {
            HtmlHelper.ClientValidationEnabled      = true;
            HtmlHelper.UnobtrusiveJavaScriptEnabled = true;

            //InitializationStructuremap.Init();
            setDbInitializer();
            ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory());

            ModelBinders.Binders.Add(typeof(DateTime), new PersianDateModelBinder());

            //  DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(FileSizeAttribute), typeof(ValidationAttribute));

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            //BundleConfig.RegisterBundles(BundleTable.Bundles);


            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new RazorViewEngine());

            MvcHandler.DisableMvcResponseHeader = true;

            ScheduledTasksRegistry.Init();
        }
コード例 #3
0
        protected void Application_Start()
        {
            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new RazorViewEngine());

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ModelBinders.Binders.Add(typeof(DateTime), new DateTimeBinder());
            ModelBinders.Binders.Add(typeof(DateTime?), new DateTimeBinder.NullableDateTimeBinder());

            SetDbInitializer();
            //Set current Controller factory as StructureMapControllerFactory
            ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory());
            ScheduledTasksRegistry.Init();
            //ISchedule myTask = new EmailSmsSchedule();
            //myTask.Run();
        }
コード例 #4
0
 protected void Application_Start(object sender, EventArgs e)
 {
     ScheduledTasksRegistry.Init();
 }