public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>(); public static IWebHostBuilder CreateWebHostBuilder(string[] args) { return WebHost.CreateDefaultBuilder(args).UseStartup<Startup>(); }
/* 写法1 */ app.Run( async (context) => { await context.Response.WriteAsync("Hello World!_001"); } ); /* 写法 2 */ test(app); app.Run( (context) // 类似于匿名函数 => { return context.Response.WriteAsync("Hello World!"); }