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();
        }
Esempio n. 2
0
        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();
            });
        }