I'm new to Swagger and Web API. I created a Web API project with a simple controller called PrimeCalculator.
public class PrimeCalculatorController : ControllerBase {
[HttpGet]
public IEnumerable<string> Get() {
//stuff
return new string[] { "value1", "value2" };
}
}
So my method in Swagger looks like this:
As you can see, there is one method with a get call. So far so good, but now I want to change method name. I found this:
[Http(name="newMethodName"]
However, the method's name stays the same. I don't know if I'm missing something. Any tutorial to learn or help is welcome.
[Http(name="newMethodName")]
-> [HttpGet("newMethodName")]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.