Exemple #1
0
        // 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);
            }
        }
Exemple #2
0
 public OrderRepository(CarsStoreContext carsStoreContext, ShopCart shopCart)
 {
     this.carsStoreContext = carsStoreContext;
     this.shopCart         = shopCart;
 }
 public UserRepository(CarsStoreContext context)
 {
     this.context = context;
 }
Exemple #4
0
 public CarRepository(CarsStoreContext carStoreContext)
 {
     this.carStoreContext = carStoreContext;
 }
Exemple #5
0
 public ShopCart(CarsStoreContext carStoreContext)
 {
     this.carStoreContext = carStoreContext;
 }