// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, YoteContext yoteContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); //yoteContext.Database.Migrate(); } app.UseHttpsRedirection(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); c.RoutePrefix = string.Empty; }); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public YoteService(YoteContext dbContext) { _dbContext = dbContext; }