I have the following API controller in Umbraco:
public class DocumentTypeController : UmbracoAuthorizedApiController
{
private IServices services;
public DocumentTypeController(IServices services)
{
this.services = services;
}
// GET: DocumentType
[HttpGet]
[Route("api/documenttype/all")]
public JsonResult<List<DocumentTypeModel>> GetAll()
{
var documentTypes = this.services.DocumentTypeService.GetAll();
return Json(documentTypes);
}
}
I'm making a call to this controller using the custom route defined on the method... however it's throwing a 404.
Is there anything special i need to do for it to register the custom route attribute defined?
My Angular plugin code is calling like this:
$http.get("http://localhost:55262/api/documenttype/all").success(function (data) {
deferred.resolve(data);
});