In my web api application, I want to enable clients to make requests, using the same path, but pass different type of parameters.
For example:
public class MyController : ApiController
{
[HttpDelete]
public IHttpActionResult Delete(int id) {..}
[HttpDelete]
public IHttpActionResult Delete2(Guid id) {..}
[HttpDelete]
public IHttpActionResult Delete3(string id) {..}
}
I want the url for each method to be similar, for example:
api/MyController/1
api/MyController/abc etc..
Is this possible? Iv'e tried alot of combinations with ActionName
attribute and Routing configuration, but nothing seemed to work.
Thanks