I have some service that I can query:
Is there a way I can restrict the query parameters? E.g. I want to report an error if someone calls the service with unsupported parameter, e.g. I want following to fail:
http://localhost/myservice/data?key=value&anyotherparam=1
I am not sure if this is the right thing to do. However I was asked if the above scenario can be implemented so I want to give a reasonable answer.
If your service ignores the
anotherparam, honestly who cares?And for those who care:
And obviously if you have to write this if over and over again across multiple actions you are better of refactoring it into a custom action filter.