This is my code. I'm trying to overload GET with 2 function :
- With one parameter
- With two parameter
I'm getting Swagger error "Failed to load API definition". Why ?
[Route("api/[controller]")]
[ApiController]
public class HospitalizedController : ControllerBase
{
[HttpGet("")]
public string Get(string MedicID)
{
string jsonData;
string connString = gsUtils.GetDbConnectionString();
// dosomething
}
[HttpGet("")]
public string Get(string MedicID, string PatientID)
{
string jsonData;
string connString = gsUtils.GetDbConnectionString();
//do something
}
}
ActionNameattribute