// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } IBooksCatalog listOfBooks = serviceProvider.GetService <IBooksCatalog>(); IBooksReport booksReport = serviceProvider.GetService <IBooksReport>(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapGet("/", async context => { await booksReport.Print(context); }); }); }
public BooksReport(IBooksCatalog booksCatalog) { this.booksCatalog = booksCatalog; }