Jacob Lee
EDIT:
You rename the controller, but do not specify a method. WebApi allows the method from the prefix GET, PUT, DELETE, POST. Therefore, the method attribute must be placed in the action signature:
Try this, works well for me:
<i>
public class LookupsController : ApiControllerBase { [HttpGet()] [ActionName("All")] public Lookups GetLookups() { var lookups = new Lookups { Customers = GetCustomers().ToList(),
}
routes.MapHttpRoute( name: "ActionApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional }
);
Take a look here for more information on routing:
Routing in the ASP.NET Web Interface
Hope this helps you!
source share