title: When to return IHttpActionResult vs Object
body: <p>In examples of using the ASP.NET Web API I see two different methods used to return data to the calling jQuery function. The first method returns an object of type <code>Client</code> but I am not sure what the second method is returning. </p>
  
  <p><strong>Method #1</strong> (returns <code>Client</code> object)</p>
  
  <pre><code>public IEnumerable&lt;Client&gt; GetAllClients()
  {
       using (var context = new PQRSModel.PQRSEntities())
       {
         context.Configuration.ProxyCreationEnabled = false; 
         var query = context.Clients.OrderBy(c = c.OrgName);
         var customers = query.ToList();
         return customers;
       }
  }
  </code></pre>
  
  <p><strong>Method #2</strong> (What benefit does <code>IHttpActionResult</code> provide?)</p>
  
  <pre><code>public IHttpActionResult GetClient(int clientId)
  {
       using (var context = new PQRSModel.PQRSEntities())
       {
         context.Configuration.ProxyCreationEnabled = false;
         var client = context.Clients.FirstOrDefault(c = c.ID == clientId);
         if (client == null)
         {
           return NotFound();
         }
         return Ok(client);
       }
  }
  </code></pre>
  
  <p>If the second method finds a single object is there any reason it could not also return a <code>Client</code> object type?</p>