gpt4 book ai didi

c# - app.UseRouting() 和 app.UseEndPoints() 有什么区别?

转载 作者:行者123 更新时间:2023-12-04 12:02:44 27 4
gpt4 key购买 nike

当我试图理解它们时,它们似乎都用于将请求路由/映射到某个端点

最佳答案

用户路由 :将请求与端点匹配。

使用端点 : 执行匹配的端点。

它将路由匹配和解析功能与端点执行功能分离,直到现在,这些功能都与 MVC 中间件捆绑在一起。

This makes the ASP.NET Core framework more flexible and allows other middlewares to act between UseRouting and UseEndpoints. That allows those middlewares to utilize the information from endpoint routing, for example, the call to UseAuthentication must go after UseRouting, so that route information is available for authentication decisions and before UseEndpoints so that users are authenticated before accessing the endpoints.

关于c# - app.UseRouting() 和 app.UseEndPoints() 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57846127/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com