title: Call async await method in sync calling method
body: <p>This is only the idea on what im doing in a window service.
  I get the idea from this <a href="https://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2287" rel="nofollow">video</a> to do it in parallel processing.</p>
  
  <p>I have two different method and a model class.</p>
  
  <p>Model Class code:</p>
  
  <pre><code>public class Email(){
      public string Recipient { get; set; }
      public string Message { get; set; }
  }
  </code></pre>
  
  <p>Methods is something like this:</p>
  
  <pre><code>public void LoadData(){
      while(Main.IsProcessRunning){
          // 1. Get All Emails
          var emails = new dummyRepositories().GetAllEmails(); //This will return List&lt;Emails&gt;.
          // 2. Send it
          // After sending assume that the data will move to other table so it will not be query again for the next loop.
          SendDataParallel(emails);//this will function async? even though the calling method is sync.
  
          // This will continue here or wait until it already send?
          // If it will continue here even though it will not send already
          // So there's a chance to get the email again for the next loop and send it again?
      }
  }
  
  //This will send email at parallel
  public async void SendDataParallel(IList&lt;Email&gt; emails){
      var allTasks = emails.Select(SendDataAsync);
      await TaskEx.WhenAll(allTasks);
  }
  
  //Assume this code will send email asynchronously. (this will not send email, for sample only)
  public async void SendDataAsync(Email email){
      using (var client = new HttpClient())
      {
          client.PostAsync(email);
      }
  }
  </code></pre>
  
  <p>I only want to get all queued emails then send it in parallel then wait until it already send.
  I'm avoiding using <code>foreach</code> on every email that I get.</p>