title: Tpl implementation issue
body: <p><a href="https://drive.google.com/open?id=0B5Qm7zuWdweWZE5GNmQ1U0dTXzg" rel="nofollow noreferrer">Tpl Sample Click here to download</a></p>
  
  <p>Hi ,
  I am trying to implement tpl in my project . where i have created 5 parallel HTTP call using web client . </p>
  
  <p><strong>What i am trying to achieve.</strong>
  If any of 5 parallel call return me string containing "First" Then kill rest call and continue with call returned "First" .</p>
  
  <p><strong>What i have tried :</strong></p>
  
  <p>I have attached sample code above. where i have used following Predicate function.</p>
  
  <pre><code>async Task&lt;T&gt; WhenAny&lt;T&gt;(IEnumerable&lt;Task&lt;T&gt;&gt; tasks, Func&lt;T, bool&gt; predicate)
      {
          var taskList = tasks.ToList();
          Task&lt;T&gt; completedTask = null;
          do
          {
              completedTask = await Task.WhenAny(taskList);
              taskList.Remove(completedTask);
          } while (!predicate(await completedTask) &amp;&amp; taskList.Any());
  
          return completedTask == null ? default(T) : await completedTask;
      }
  </code></pre>
  
  <p>And calling this as below:</p>
  
  <pre><code> public async Task&lt;string&gt; methodname()
      {
          string sUrl = "https://abcd.com/test.php";
          Task&lt;string&gt; task1 = DownLoadData(sUrl);
          Task&lt;string&gt; task2 = DownLoadData(sUrl);
          Task&lt;string&gt; task3 = DownLoadData(sUrl);
          Task&lt;string&gt; task4 = DownLoadData(sUrl);
          Task&lt;string&gt; task5 = DownLoadData(sUrl); 
          var tasks = new[] { task1, task2, task3, task4, task5 };
          await WhenAny(tasks, t =&gt; t.Contains("First"));
  
          return "";
  
  
      }
  </code></pre>
  
  <p>But it don't met criteria. Please suggest where i am missing something. Any help would be appreciated.</p>