I want to expose 2 new endpoints on my controller. 1 has the method signature to add a single entity:
[HttpPost]
[Route("v1/entities")]
public IHttpActionResult AddEntity([FromBody] Entity entity)
The other is almost identical except it accepts an IEnumerable to add multiple entities:
[HttpPost]
[Route("v1/entities")]
public IHttpActionResult AddEntities([FromBody] IEnumerable<Entity> entities)
Clearly this won't work since it won't know what action method to call. So how can I get around this to support both methods. Should I simply rename the second route to something like "v1/entitieslist"?
Thanks