title: Running Async Foreach Loop C# async await
body: <p>I am struggling to grasp the basic concept of c# async await.</p>
  
  <p>Basically what I have is a List of objects which I need to process, the processing involves iterating through its properties and joining strings, and then creating a new object (in this case called a trellocard) and eventually adding a list of trellocards.</p>
  
  <p>The iteration takes quiet a long time, So what I would like to do is process multiple objects at asynchronously. </p>
  
  <p>I've tried multiple approaches but basically I want to do something like this. (in the below example I have removed the processing, and just put system.threading.thread.sleep(200). Im await that this is NOT an async method, and I could use tasks.delay but the point is my processing does not have any async methods, i want to just run the entire method with multiple instances.</p>
  
  <pre><code>    private async Task&lt;List&lt;TrelloCard&gt;&gt; ProcessJobs(IQueryable&lt;IGrouping&lt;CardGrouping, Job&gt;&gt; jobs)
      {
          List&lt;TrelloCard&gt; cards = new List&lt;TrelloCard&gt;();
  
          foreach (var job in jobs.ToList())
          {
             card = await ProcessCards(job, cards);  // I would like to run multiple instances of the processing
             cards.add(card); //Once each instance is finshed it adds it to the list
          }
  
  
    private async Task&lt;TrelloCard&gt; ProcessCards(Job job)
      {
          System.Threading.Thread.Sleep(2000);  //Just for examples sake
  
          return new TrelloCard();
      }
  </code></pre>