コード例 #1
0
        // 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);
                });
            });
        }
コード例 #2
0
 public BooksReport(IBooksCatalog booksCatalog)
 {
     this.booksCatalog = booksCatalog;
 }