How to make IRouteConstraint filter route
问题 I wrote a custom route constraint, but its filter just doesn't get recognized. Does anyone have an example working use of IRouteConstraint ? Also, note to developers: I get double display of the form on my android. Something must be wrong with the partial rendering? 回答1: Here's a simple constraint that looks up an article slug in a fictional repository: public class SlugRouteConstraint : IRouteConstraint { private readonly ISlugRepository slugRepository = new SlugRepository(); public bool