I have a .NET 4.5 MVC 4 project that I have added to it the webapi.helppage package via NuGet.
Then they added ApiController to my project below:
public class ValuesController : ApiController { // GET api/values public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } // GET api/values/5 public string Get(int id) { return "value"; } // POST api/values public void Post([FromBody]string value) { } // PUT api/values/5 public void Put(int id, [FromBody]string value) { } // DELETE api/values/5 public void Delete(int id) { } }
to see if the help page works, but returns an empty apidescription collection to call GetApiExplorer() :
public ActionResult Index() { return View(Configuration.Services.GetApiExplorer().ApiDescriptions); }
However, I can use an example api controller, for example, using /api/values .
Does anyone know why apidescription will not be found?
Pricey
source share