// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, MasterShopDbContext db) { var rolesConfig = new RolesExtensionsConfiguration(app, db); rolesConfig.CreateRoles().Wait(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler(GlobalConstants.ExeptionHandlerErr); // 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.UseCookiePolicy(); app.UseRouting(); app.UseSession(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: GlobalConstants.Name, pattern: GlobalConstants.Pattern); endpoints.MapRazorPages(); }); }
public ProductsService(MasterShopDbContext db) { this.db = db; }
public RolesExtensionsConfiguration(IApplicationBuilder app, MasterShopDbContext db) { this.app = app; this.db = db; }
public OrdersService(MasterShopDbContext db) { this.db = db; }
public CategoriesService(MasterShopDbContext db) { this.db = db; }
public UsersService(MasterShopDbContext db, IMapper mapper) { this.db = db; this.mapper = mapper; }