ASP.NET seems to implicitly interpret the method named GetX and PostX as the GET and POST methods, respectively, since their names have the HTTP method name prefix. This also applies to PUT and DELETE.
I have a method, unfortunately, with the name Delete , but I want it to be interpreted as POST, so I explicitly specify its POST using the [HttpPost] attribute. This works if it is not declared inside the interface ...
public interface IFooBarController { [HttpPost] void DoSomething(); [HttpPost] void Delete(int id); } public class FooBarController : IFooBarController { public void DoSomething() {
How can I get around this without specifying an HttpPostAttribute for each implementation?
Ruud lenders
source share