RouteBuilder vs EndpointRoutbuilder .net

发布于 2025-01-28 12:35:19 字数 407 浏览 4 评论 0原文

我正在尝试在路由场景背后学习,并发现webapplication实现iendpoIntRouteBuilder,它允许其定义路由,例如使用mapget或甚至useEndPoint中间件本身在场景后面使用它。我还看到了另一种类型和接口,它与此类型非常相似,但在任何方式上都不相关:RouteBuilder。它还具有从MAP开头的方法,并且似乎具有iendPoIntRouteBuilder的用法相同。在.NET 6中的路由中,在哪里使用RouteBuilder,它是过时的还是已使用?那是什么用法,而iendPoIntRouteBuilder无法实现的用法?谢谢

I am trying to learn behind the scene of Routing and I find out that WebApplication implements IEndpointRouteBuilder which allows it to define routes for example using MapGet or even the UseEndpoint middleware itself use it behind the scene. I also see another type and interface which was very similar to that but not related in any way to it: RouteBuilder. It also has methods starting with Map and seems that have same usage with IEndpointRouteBuilder. Where is used RouteBuilder in the routing in .Net 6 and does it is obsolete or it is used yet? What is the usage then which can not implemented by IEndpointRouteBuilder? Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦言归人 2025-02-04 12:35:19

看来,在当前的用户outing()和useEndPoints()的方法之前,该方法是使用UserOuter(irouter Router)中间件,该中间软件获得了从RouterBuilder获得的IROUTER参数。以下链接中的更多信息:

It seems that before current approach of UseRouting() and UseEndpoints() the approach is to use UseRouter(IRouter router) middleware which get an IRouter argument which get from RouterBuilder. More information in following link:
Routing in Asp.Net 2.1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文