| How can we enable attribute routing in Web API?
To enable attribute routing in Web API we use MapHttpAttributeRoutes(); method and this method is called in the WebApi config file. Below is the synatx to enable attribute:-
public static void Register(HttpConfiguration config)
{
//for Web API routes
config.MapHttpAttributeRoutes();
//and other Web API configuration not display
}
| | |