Example #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");

            if (bool.Parse(ConfigurationManager.AppSettings["MigrateDatabaseToLatestVersion"]))
            {
                var configuration = new CalculationCSharp.Migrations.Configuration();
                var migrator = new DbMigrator(configuration);
                migrator.Update();
                var configurationApplication = new CalculationCSharp.Migrations.configurationApplication();
                var migratorApplication = new DbMigrator(configurationApplication);
                migratorApplication.Update();
            }
        }
Example #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
            GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Serialize;

            if (bool.Parse(ConfigurationManager.AppSettings["MigrateDatabaseToLatestVersion"]))
            {
                var configuration = new CalculationCSharp.Migrations.Configuration();
                var migrator      = new DbMigrator(configuration);
                migrator.Update();
                var configurationApplication = new CalculationCSharp.Migrations.configurationApplication();
                var migratorApplication      = new DbMigrator(configurationApplication);
                migratorApplication.Update();
            }
        }