Why .Net MVC (.Net 4.8) do not show static methods API in API Explorer / Help page?

51 Views Asked by At

I have this API,

    [HttpPut]
    [CustomExceptionFilter]
    [Route("api/Port/SetExternalEngineLights")]
    public string SetExternalEngineLights()
    {
        return "...something"
    }

It then will show up in help page, enter image description here

But if I set the method to be static, the method disappeared from help page.

    [HttpPut]
    [CustomExceptionFilter]
    [Route("api/Port/SetExternalEngineLights")]
    public static string SetExternalEngineLights()
    {
        return "...something"
    }

Google yield no meaningful results. Are there any fix or workaround?

0

There are 0 best solutions below