Efrain Flores

Efrain Flores

  • NA
  • 11
  • 16.6k

MapHttpAttributeRoutes not working

Jul 1 2016 11:33 AM
I have a Web API 2 project that is now throwing the following error message:
 

The inline constraint resolver of type 'DefaultInlineConstraintResolver' was unable to resolve the following inline constraint: 'id'.

 
I am wondering why it started doing this now since my WebApiCOnfig hasn't changed (See below)
 
public static void Register(HttpConfiguration config)         
{             // Web API configuration and services             
config.Filters.Add(new GeneralActionFilter());             
config.Filters.Add(new GeneralExceptionFilterAttribute());                          
// Web API routes - Allows Actions to define a route via Attribute             
config.MapHttpAttributeRoutes();  
             
config.Routes.MapHttpRoute(                 
name: "DefaultApi",                 
routeTemplate: "api/{controller}/{id}",                 
defaults: new { id = RouteParameter.Optional } ); 

}
 
 None of my api calls are working now. I was hoping that the config.MapHttpAttributeRoutes(); would help, but it seems like it is not doing anything at all even though I have routes such as this: [Route("students/{studentId:int}/homeschoolverifications")] 
 
 I'll appreciate any help you can give me...
 
 

Answers (1)