// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ProductQualityDbContext dbContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseCors(c => { c.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader(); }); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "TopGlove API V1"); }); dbContext.Database.EnsureCreated(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public UserController(ProductQualityDbContext dbContext) { _dbContext = dbContext; }