title: Asp.net WebAPI: Aborted (cancelled) requests
body: <p>For starters, this is a discussion if anyone of you guys does such a thing as request cancellation in WebAPI controllers (probably also applicable for MVC).</p>
  
  <p>What I mean in particular is a scenario like the following: 
  A client (browser typically) starts a request, navigates away or more general, aborts the request for any reason. Now, the request is aborted on the client side and will no longer be considered. But on the server side the request is still executing and typically might be doing two things especially interesting:</p>
  
  <ul>
  <li>Make a (heavy) DB-Query</li>
  <li>Make a (heavy) service call to another service</li>
  </ul>
  
  <p>And all for nothing in the end (at least when it's a side-effect free read operation at least).</p>
  
  <p>Does somebody handle cancellation of the ongoing query/service call in such a case?</p>
  
  <p>What I know is that a <code>CancellationToken</code> can be passed in the API-Controller (even though I couldn't get it working so that cancellation was really requested when aborting from the client).
  This <code>CancellationToken</code>, in theory, would need to be passed down to all lower layers to handle a probable cancellation of database and service calls.</p>