title: Why should I use IHttpActionResult instead of HttpResponseMessage?
body: <p>I have been developing with WebApi and have moved on to WebApi2 where Microsoft has introduced a new <code>IHttpActionResult</code> Interface that seems to recommended to be used over returning a <code>HttpResponseMessage</code>. I am confused on the advantages of this new Interface. It seems to mainly just provide a <strong>SLIGHTLY</strong> easier way to create a <code>HttpResponseMessage</code>. </p>
  
  <p>I would make the argument that this is "abstraction for the sake of abstraction". Am I missing something? What is the real world advantages I get from using this new Interface besides maybe saving a line of code?</p>
  
  <p><strong>Old way</strong> (WebApi):</p>
  
  <pre><code>public HttpResponseMessage Delete(int id)
  {
      var status = _Repository.DeleteCustomer(id);
      if (status)
      {
          return new HttpResponseMessage(HttpStatusCode.OK);
      }
      else
      {
          throw new HttpResponseException(HttpStatusCode.NotFound);
      }
  }
  </code></pre>
  
  <p><strong>New Way</strong> (WebApi2):</p>
  
  <pre><code>public IHttpActionResult Delete(int id)
  {
      var status = _Repository.DeleteCustomer(id);
      if (status)
      {
          //return new HttpResponseMessage(HttpStatusCode.OK);
          return Ok();
      }
      else
      {
          //throw new HttpResponseException(HttpStatusCode.NotFound);
          return NotFound();
      }
  }
  </code></pre>