I've got a get method which accepts a set of optional parameters.
public HttpResponseMessage Get([FromUri] Parameter parameter)
---------------------------
public class Parameter
{
public string TransactionStatus { get; set; }
public string AllVersions { get; set; }
public string RunNumber { get; set; }
}
I'm calling api using api/item?transactionStatus=1 or api/item?transactionStatus=1&allVersions=true. My question is how could I catch/prevent the misspelled parameters in request? Let's say if api/item?transactionStatus=1&MISSPELLED=true is called, I want to throw an error "url is not valid".