Web Api 2 の属性ルーティングに取り組んでいます。正規表現を含むルートを実装しようとしています
URLはこのようにする必要があります
/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$'.
ここにエラーのスクリーンショットがあります
私を助けてください 。ありがとう