3

PluralSight.com の SPA に関する John Papa のコースをたどろうとしているところ、この奇妙な問題に遭遇しました。

   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'."}

なんで?

4

1 に答える 1