// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, CoffeeClubContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } context.EnsureCreated(); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseCors("CorsPolicy"); app.UseSession(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public CoffeeController(CoffeeClubContext context) { this.context = context; }