我在 ASP.NET MVC 5 项目中有以下内容:
DefaultInlineConstraintResolver resolver = new DefaultInlineConstraintResolver();
resolver.ConstraintMap.Add("notetype", typeof(EnumConstraint<NoteType>));
RouteTable.Routes.MapMvcAttributeRoutes(resolver);
GlobalConfiguration.Configuration.MapHttpAttributeRoutes(resolver);
在最后一行,解析器在 MapHttpAttributeRoutes 上不被接受。我怎样才能做到这一点?