, . api/action?participantId=1&participantType=2
, api/action?programName=x
:
public class ParticipantQuery {
public string participantId { get; set; }
public string participantType { get; set; }
public string programName { get; set; }
}
[Route("api/[controller]")]
public class TermsController : Controller {
[HttpGet("participants")]
[ActionName(nameof(GetByParticipant))]
public async Task<IActionResult> GetByParticipant([FromQuery]ParticipantQuery model) {
}
[HttpGet("programs/{programName}")]
[ActionName(nameof(GetByProgram))]
public async Task<IActionResult> GetByProgram(string programName) {
}
}
,
public class GetTermsQuery {
public string participantId { get; set; }
public string participantType { get; set; }
public string programName { get; set; }
}
[Route("api/[controller]")]
public class TermsController : Controller {
[HttpGet]
public async Task<IActionResult> Get([FromQuery]GetTermsQuery model) {
}
}