Exemplo n.º 1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IMigrationManager migrationManager, ISeedService seedService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/JobOffer/Error");
            }

            app.UseStaticFiles();
            app.UseStatusCodePagesWithReExecute("/JobOffer/Error", "?statusCode={0}");
            app.UseRequestLocalization();
            app.UseAuthentication();

            migrationManager.Apply().Wait();
            seedService.Seed().Wait();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=JobOffer}/{action=Popular}/{id?}");
            });
        }
Exemplo n.º 2
0
        public void Migrate(IEnumerable <M> migrationRules)
        {
            var migrationEnumerator = new ApplicableMigrationEnumerator <M>(
                new HashSet <M>(migrationRules), migrationManager);

            while (migrationEnumerator.MoveNext())
            {
                migrationManager.Apply(migrationEnumerator.Current);
            }
        }