title: Web API custom validation to check string against list of approved values
body: <p>I'd like to validate an input on a Web API REST command. I'd like it to work something like <code>State</code> below being decorated with an attribute that limits the valid values for the parameter.</p>
  
  <pre><code>public class Item {
      ...
  
      // I want State to only be one of "New", "Used", or "Unknown"
      [Required]
      [ValidValues({"New", "Used", "Unknown"})]
      public string State { get; set; }
  
      [Required]
      public string Description { get; set; }
  
      ...
  }
  </code></pre>
  
  <p>Is there a way to do this without going against the grain of Web API. Ideally the approach would be similar to Ruby on Rails' <a href="http://guides.rubyonrails.org/v2.3.11/activerecord_validations_callbacks.html#creating-custom-validation-methods" rel="noreferrer">custom validation</a>.</p>