Skip to content

Instantly share code, notes, and snippets.

@shawnwildermuth
Created August 26, 2017 18:20
Show Gist options
  • Save shawnwildermuth/e2489de996d0df97705d85b21d048660 to your computer and use it in GitHub Desktop.
Save shawnwildermuth/e2489de996d0df97705d85b21d048660 to your computer and use it in GitHub Desktop.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseStaticFiles();
app.UseAuthentication();
app.UseMvc(cfg =>
{
cfg.MapRoute("Fallback", "{controller}/{action}/{id?}", new { controller = "Root", action = "Index" });
});
if (env.IsDevelopment())
{
using (var scope = app.ApplicationServices.CreateScope())
{
var seeder = scope.ServiceProvider.GetService<DutchSeeder>();
seeder.SeedAsync().Wait();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment