RouteBuilder vs EndpointRoutbuilder .net
我正在尝试在路由场景背后学习,并发现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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来,在当前的用户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