// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseSession(); app.UseAuthorization(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Login}/{action=Authorization}/{id?}"); }); using (var scope = app.ApplicationServices.CreateScope()) { CarsStoreContext content = scope.ServiceProvider.GetRequiredService <CarsStoreContext>(); DbObjects.Initialize(content); } }
public OrderRepository(CarsStoreContext carsStoreContext, ShopCart shopCart) { this.carsStoreContext = carsStoreContext; this.shopCart = shopCart; }
public UserRepository(CarsStoreContext context) { this.context = context; }
public CarRepository(CarsStoreContext carStoreContext) { this.carStoreContext = carStoreContext; }
public ShopCart(CarsStoreContext carStoreContext) { this.carStoreContext = carStoreContext; }