我正在研究 Web Api 2 的属性路由。我正在尝试实现一个包含正则表达式的 Route
网址应该是这样的
/xyz/sale
/xyz/rent
我尽了最大的努力,在谷歌上搜索了很多,但在风向标。我尝试的是
[Route(@"xyz/{Type:^sale|rent$}")]
但它给出了以下错误
The inline constraint resolver of type 'DefaultInlineConstraintResolver'
was unable to
resolve the following inline constraint: '^sale|rent$'.
这是错误的屏幕截图
请帮帮我。谢谢