Michael was right in saying ApiExplorer . This gives you detailed information about all WebApi methods for you. You just need to format it as you want an answer.
Here is a simple example to get a list of all methods with their parameters and return types. Of course, you can make this much more comprehensive - just scan the objects to find what you need:
using System.Collections.Generic; using System.Linq; using System.Web.Http; using System.Web.Http.Description; namespace WebApplication1.Controllers { public class ApiMethodController : ApiController { public IEnumerable<HelpMethod> GetMethods() {
It's nice that this is the WebApi call itself, so you can use the HttpClient to call and process it using http://www.localhost.com/api/ApiMethod/Methods . Here is an example JSON response:
[ { "Method": "GET", "RelativePath": "api/Account/{id}", "ReturnType": "WebApplication1.Models.Account", "Parameters": [ { "Name": "id", "Type": "System.Int32", "IsOptional": false } ] }, { "Method": "POST", "RelativePath": "api/Account", "ReturnType": null, "Parameters": [ { "Name": "a", "Type": "WebApplication1.Models.Account", "IsOptional": false } ] }, { "Method": "GET", "RelativePath": "api/Maths?i={i}&j={j}", "ReturnType": "System.Int32", "Parameters": [ { "Name": "i", "Type": "System.Int32", "IsOptional": false }, { "Name": "j", "Type": "System.Int32", "IsOptional": false } ] } ]
Forward
Getting comments on XML documents is not so clear, but there is a tutorial on MSDN Blogs .
In addition, there are other packages available that you can use to capture, steal, which are similar to what you need, for example
More on these in VS Mag
Rhumborl
source share