コード例 #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, IConfiguration configuration, ITimer timer)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            Person p = new Person();

            configuration.Bind(p);

            var company = (from item in configuration.GetChildren() where (int.TryParse(item.Value, out int x) && x > 100) orderby item.Value descending select item.Key).FirstOrDefault();

            app.Run(async context => await context.Response.WriteAsync((company ?? "company is not found") + "\n" + p.ToString() + "\n" + timer.GetPartOfDay()));
        }