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?}"); }); }
public void Migrate(IEnumerable <M> migrationRules) { var migrationEnumerator = new ApplicableMigrationEnumerator <M>( new HashSet <M>(migrationRules), migrationManager); while (migrationEnumerator.MoveNext()) { migrationManager.Apply(migrationEnumerator.Current); } }