title: Await Inside Foreach Keyword
body: <p>I have a <code>List</code> of <code>Task&lt;bool&gt;</code> that i want to iterate it and depending on the awaited result i decide whether to continue or break but ironically the <code>foreach</code> just executes the tasks and await keyword does not work</p>
  
  <p>Here is my code</p>
  
  <pre><code>private async void Execute(object sender, EventArgs e)
  {
      var tList = new List&lt;Task&lt;bool&gt;&gt; { Method1(), Method2()};
  
      foreach (var task in tList)
      {
          var result = await task;
  
          if(!result)
              break;
      }
  }
  
  public async Task&lt;bool&gt; Method1()
  {
      await Task.Delay(1000);
      Console.WriteLine("Method1");
      return false;
  }
  
  public async Task&lt;bool&gt; Method2()
  {
      await Task.Delay(1000);
      Console.WriteLine("Method2");
      return true;
  }
  </code></pre>
  
  <p><em><strong>Result : Both functions are execute.</em></strong></p>
  
  <p>Question : How could i use await inside <code>foreach</code> ?.</p>
  
  <p>And <strong>thanks</strong> in advance. </p>