title: Run tasks sequentially
body: <p>I have five windows services. I run the services sequentially. </p>
  
  <pre><code>if(a_Condition)
  { 
       services[0] = new Processing_0();
  // blah blah
  }
  if(b_Condition)
  {
      service[1] = new Processing_1();
  // blah blah
  }
  if(c_Condition)
  {
      service[2] = new Processing_2();
  // blah blah
  }
  if(d_Condition)
  {
      service[3] = new Processing_3();
  // blah blah
  }
  if(e_Condition)
  {
      service[4] = new Processing_4();
  // blah blah
  }
  </code></pre>
  
  <p>For some reason, I want to use task, the code is:</p>
  
  <pre><code>Task.StartNew(() =&gt; {
  if (a_Condition) { var x = new Processing_0(); ... }
  })
  .ContinueWith(() =&gt; {
  if (b_Condition) { var x = new Processing_1(); ... }
  })
  .ContinueWith(() =&gt; {
  if (c_Condition) { var x = new Processing_2(); ... }
  }) 
  .ContinueWith(() =&gt; {
  if (d_Condition) { var x = new Processing_3(); ... }
  })
  .ContinueWith(() =&gt; {
  if (e_Condition) { var x = new Processing_4(); ... }
  });
  </code></pre>
  
  <p>Is that okay?</p>