我在Umbraco中有以下API控制器:
Date Currency Location Company Price
11112012 GBP London EasyJet 200.00
12122012 GBP Manchester British Airways 100.00
10102014 EUR Frankfurt Lufthansa 300.00
10102014 EUR Paris Air France 500.00
我正在使用方法中定义的自定义路径调用此控制器...但它正在抛出404.
我需要做些什么特别的事情来注册定义的自定义路由属性吗?
我的Angular插件代码是这样调用的:
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);
}
}