In my controller I have action like this:
[Route("api/[controller]")]
[ApiController]
public class ManageOPIdentifierController : ControllerBase
{
[HttpGet("[action]")]
public OPIdentifiersVM Get(int pageSize, int pageNumber)
{
How to add parameters pageSize and pageNumber to HttpGet? Because now when I have second method Get without parameters I get error because there are two routes with the same definition. How should looks the first HttpGet route?
[HttpGet("[action]/{pageSize}&{pageNumber}")]
Code above doesn't work
Edit: My question has been misunderstood. I have two methods Get:
[HttpGet("[action]")]
public OPIdentifiersVM Get(int pageSize, int pageNumber)
and
[HttpGet("[action]")]
public List<OPIdentifierVM> Get()
There is no problem to read values from parameters pageSize and pageNumber. The problem is that I have two methods with the same Http("[action]"). And I get error:
AmbiguousMatchException: The request matched multiple endpoints. Matches:
ManageUuidWeb.Controllers.ManageOPIdentifierController.Get (OneProjectIdentifier.Web)
ManageUuidWeb.Controllers.ManageOPIdentifierController.Get (OneProjectIdentifier.Web)
If I good understood the comment I have to change name one of the method. But I want to know if it is possible to have two methods with the same name but with different parameters?