0

This is in .NET 6

The Action method:

[HttpGet("GetCustomers/{customerName?}/{customerNumber?}/{customerSignature?}")]
public async Task<IEnumerable<Customer>> GetCustomers(string customerName = null, string customerNumber = null, string customerSignature = null)
{

This url hits the method:

https://localhost:44378/api/Customer/GetCustomers/A/B/C

But below url doesn't hit the method:

https://localhost:44378/api/Customer/GetCustomers/A//C

Any solution?

Nands
  • 379
  • 3
  • 19
  • Does this answer your question? [Web API optional parameters](https://stackoverflow.com/questions/38249019/web-api-optional-parameters) – Chin. Udara Jun 02 '23 at 13:56

0 Answers0