看起来以下两个正在工作:
这两种映射方式有什么区别?
app.UseRouting();
// http://localhost/apple
app.UseEndpoints(endpoints =>
{
endpoints.Map("/apple", async context =>
{
await context.Response.WriteAsync("this is an apple");
});
});
// http://localhost/orange
app.Map("/orange", orangeApp =>
{
orangeApp.Run(async context =>
{
await context.Response.WriteAsync("this is an orange");
});
});
这两种映射方式有什么区别?