title: How to get rid of Cannot await 'void' in C#
body: <p>Below is how my sample application looks like to explore <code>async/await</code> &amp; <code>TPL</code></p>
  
  <pre><code>class Program
  {
      static async void Main(string[] args)
      {
  
          Console.WriteLine("Order for breakfast");
          Breakfast obj = new Breakfast();
          Task t1 = Task.Run(() =&gt; obj.MakeTea());
          Task t2 = Task.Run(() =&gt; obj.ToastBread());
          Task t3 = Task.Run(() =&gt; obj.BoilEgg());
          Console.WriteLine("Breakfast ready");
          var res = await Task.WaitAll(t1, t2, t3); // LOE - throwing error
      }
  }
  
  class Breakfast
  {
      //making a tea
      public string MakeTea()
      {
          return "tea";
  
      }
  
      //toasting bread
      public string ToastBread()
      {
          return "bread";
      }
  
      //boil eggs
      public string BoilEgg()
      {
          return "egg";
      }
  }
  </code></pre>
  
  <p>at #LOE compiler is throwing build error as</p>
  
  <blockquote>
    <p>cannot await void</p>
  </blockquote>
  
  <p>my query here is</p>
  
  <ol>
  <li>I don't have methods as void still why it is throwing such error?</li>
  <li>Why can't void be await?</li>
  </ol>
  
  <p>How to get rid of this ?
  Thanks!</p>