// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, TDSDbContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); // Enable middleware to serve generated Swagger as a JSON endpoint. app.UseSwagger(); // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), // specifying the Swagger JSON endpoint. app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "TDS API V1"); }); app.UseRouting(); app.UseHealthChecks("/health-check"); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); if (!context.Database.EnsureCreated()) { context.Database.Migrate(); } }
public Repository(TDSDbContext dbContext) { _dbContext = dbContext; }