1
나는 PluralSight.com에서 SPA에 대한 John Papa의 코스를 따라 가려고하는데,이 이상한 문제에 부딪 혔습니다.내 [ActionName] 속성이 작동하지 않는 이유는 무엇입니까?
public class LookupController : ApiControllerBase
{
// GET: api/lookup/samples
[ActionName("samples")]
public IEnumerable<Sample> GetSamples()
{
return Uow.Samples.GetAll().OrderBy(x => x.Name);
}
}
내가 localhost:49210/api/lookup/getsamples
를 사용하고 난 샘플의 목록을합니다. 내가 localhost:49210/api/lookup/samples
사용할 때, 나는 다음있어 오류 :
{"message":"No HTTP resource was found that matches the request URI
'http://localhost:49210/api/lookup/samples'.","messageDetail":"No
action was found on the controller 'Lookup' that matches the name
'samples'."}
이유는 무엇입니까?