Return an error when invalid parameters are specified in ASP Web API
I'm creating an API using C# and ASP.NET Web API and I want it to return an error when a parameter is used that isn't recognised. For example: /api/Events should a list of events /api/Events?startTime={{startTime}} should return a list of events that started at a particular time /api/Events?someRandomInvalidParameter={{something}} should return an error Is there a nice config way to do this? If not, how can I get a list of parameters to check myself. You could create an ActionFilter to automate this: public class InvalidQueryStringRejectorAttribute : ActionFilterAttribute { public override