title: Error Handling for ASP.NET Odata Web API
body: <p>I'm interested in knowing what are the best practices being followed to raise exceptions in the ODataController.</p>
  
  <p>If you raise an exception in the method it is translated to response code of 500 by default and the content has details on the error. I would like to be explicit of the response code and send 400 in cases of invalid key.</p>
  
  <p>For example: If the input request has an invalid key would like to return a HttpResponseCode of 400 and content should have the error details similar to raising an exception. </p>
  
  <p>Thanks a lot for your inputs</p>