public override void Configure(IApplicationBuilder app, IHostingEnvironment env) { var employeesContext = app.ApplicationServices.GetService <EmployeesContext>(); EmployeesContextDataFeeder.Feed(employeesContext); var carsContext = app.ApplicationServices.GetService <CarsContext>(); CarsContextDataFeeder.Feed(carsContext); app.UseMvc(); }
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env) { var employeesContext = app.ApplicationServices.GetService <EmployeesContext>(); EmployeesContextDataFeeder.Feed(employeesContext); var carsContext = app.ApplicationServices.GetService <CarsContext>(); CarsContextDataFeeder.Feed(carsContext); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }