【发布时间】:2018-03-14 18:15:49
【问题描述】:
当请求包含多个路径且 URL 始终以 /end 结尾时,我正在尝试找到一种匹配路由的方法
例如:
domain.com/api/path1/path2/path3/end
domain.com/api/path1/path2/path3/path4/end
我尝试了[Route("api/{p:regex(([[\\w-]]*\\/){{1,}})}end")],但没有成功。
有什么推荐吗?
【问题讨论】:
-
你试过什么没用?
-
我试过这个但是在[Route("api/{p:regex(([[\\w-]]*\\/){{1,}})}end")]这不起作用:-(
-
您是否会编辑您的问题以添加您使用的代码,但没有按预期工作?
-
谢谢
标签: .net regex asp.net-core routes routeattribute