コード例 #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();
        }
コード例 #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();
            });
        }