I have problem with managing multiple actions on same route when trying to access HttpDelete controller method.
[Route("api/doctors/{id}/{type}")]
[HttpDelete]
public async Task<IHttpActionResult> Toggle(int id, string type)
{
switch (type)
{
case "delete":
return Ok(await Delete(id));
case "disable":
return Ok(await Disable(id));
case "block":
return Ok(await Block(id));
default:
return NotFound();
}
}
Like this, I am using verbs in the route, but I like to avoid them. Can somebody tell me better way to manage them?