title: DefaultInlineConstraintResolver was unable to resolve CustomRouteConstraint - Web API
body: <p>This issue was raise twice on SO, I have tried those solutions, but it is not working for me.</p>
  <p>I am trying to create CustomRouteConstraint for a ComplexObject which is a parameter in ActionMethod, where HttpPost is used.</p>
  <p>I am following this url to implement Custom Routing.</p>
  <p><a href="https://docs.microsoft.com/en-us/aspnet/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2</a></p>
  <p><strong>1. Creating CustomRouteConstraint.</strong></p>
  <pre><code> public class CustomRouteConstraint : IHttpRouteConstraint
      {
  
          public bool Match(HttpRequestMessage request, IHttpRoute route, string parameterName, IDictionary&lt;string, object&gt; values, HttpRouteDirection routeDirection)
          {
              object value;
  
              if (values.TryGetValue(parameterName, out value) &amp;&amp; value != null)
              {
                  return true;
              }
              return false;
          }
      }
  </code></pre>
  <p><strong>2. MapAttribute in WebAPIConfig.cs file</strong></p>
  <pre><code>public static class WebApiConfig
      {
  
      public static void Register(HttpConfiguration config)
      {
  
          var constraintResolver = new DefaultInlineConstraintResolver();
          constraintResolver.ConstraintMap.Add(&quot;CustomObjRouteConstraint&quot;, typeof(CustomRouteConstraint));
          config.MapHttpAttributeRoutes(constraintResolver);
         
          
      }
  }
  </code></pre>
  <p><strong>3. Using Constraint in ActionMethod.</strong></p>
  <pre><code>    [Route(&quot;Address/{param:CustomObjRouteConstraint}&quot;)]
          [HttpPost]
          public AddressUpdateResult UpdateCustomerAddresses(UpdateCustomerAddressCommand param)
          {
             Handle(param);
              return xyz;
          }
  </code></pre>
  <p>At run-time I get error :</p>
  <blockquote>
  <p>&quot;DefaultInlineResolver was unable to resolve CustomRouteConstraint &quot;</p>
  </blockquote>