Ejemplo n.º 1
0
        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();
        }
Ejemplo 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();
            });
        }