Example #1
0
        protected void Application_Start()
        {
            //GlobalConfiguration.Configuration.MessageHandlers.Add(
            //    new Pipeline.AuthMessageHandler()
            //);

            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            Database.SetInitializer <Repository.RepoContext>(new
                                                             MigrateDatabaseToLatestVersion <Repository.RepoContext, WebApiSoup.Repository.Migrations.Configuration>()
                                                             );

            //Touch Repository to Create if not exists
            using (var context = new Repository.RepoContext())
            {
                context.Database.Initialize(true);
            }
        }
Example #2
0
        protected void Application_Start()
        {
            //GlobalConfiguration.Configuration.MessageHandlers.Add(
            //    new Pipeline.AuthMessageHandler()
            //);

            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            Database.SetInitializer<Repository.RepoContext>(new
                    MigrateDatabaseToLatestVersion<Repository.RepoContext, WebApiSoup.Repository.Migrations.Configuration>()
            );

            //Touch Repository to Create if not exists
            using (var context = new Repository.RepoContext())
            {
                context.Database.Initialize(true);
            }
        }