title: How to set custom headers when using IHttpActionResult?
body: <p>In ASP.NET Web API 2, the <code>IHttpActionResult</code> offers a lot of value in simplifying controller code and I'm reluctant to stop using it, but I've hit a problem. </p>
  
  <p>I need to set an ETag on an outgoing response, and I cannot find any property which gives me access to the response's headers. At the moment I'm using the <code>Ok&lt;T&gt;(T content)</code> helper method from the <code>ApiController</code>, which returns an <a href="http://msdn.microsoft.com/en-us/library/dn308866%28v=vs.118%29.aspx" rel="noreferrer"><code>OkNegotiatedContentResult&lt;T&gt;</code></a> object. That doesn't seem to have anything exposed which would let me modify the headers though.</p>
  
  <p>Am I missing something, or is there really no way to do this while using the stock <code>IHttpActionResult</code> types? I considered a message handler, but then I'd have to figure out how to pass the ETag out of the action (the ETags are generated differently for different actions, so it's not a matter of making a generic handler for all actions).</p>
  
  <p>I'd like to avoid having to use the raw HttpResponseMessage, but at the moment that's looking difficult.</p>