// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ProjectRSPContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } using (context) { //context.Database.EnsureDeleted(); context.Database.EnsureCreated(); } app.UseHttpsRedirection(); app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "ProjetoRSP v1")); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public PacientesController(ProjectRSPContext context) { _context = context; }