I have a .NET 4.5 MVC 4
project which I have added the webapi.helppage
package to it via NuGet.
Then added an ApiController
to my project of the 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 is working, but it returns an empty apidescription
collection for the below GetApiExplorer()
call:
public ActionResult Index()
{
return View(Configuration.Services.GetApiExplorer().ApiDescriptions);
}
I can however use the example api controller by navigating to /api/values
for example.
Anyone know why the apidescription
wouldn't be found?