title: Delay a block of code
body: <p>In my WebApi project I have an endpoint that should delay a small block of code.
  Let's make an example:</p>
  
  <p>I need to implement a mechanism that permit the client to book for a resource. The booking time should only have a duration of 120 seconds and then expire.
  In terms of code I have something like this:</p>
  
  <pre><code>//booking
  foreach (var item in list) {
      item.Status = ItemStatus.Booked;
  }
  await _context.SaveChangesAsync();
  
  //Setup a delayed "thread" which removes the booking
  Task.Delay( TimeSpan.FromMinutes( 2 ) )
      .ContinueWith( x =&gt; {
          //loop on the list and set the status to "ReadyForSale"
          //if this is still in the Booking
      } );
  
  return;
  </code></pre>
  
  <p>I would like to understand if a solution like this satisfy my requirement. The current thread should not be blocked from the delayed task and I need to find a way to pass the list of items to the delayed task.</p>