title: How to get list of files for every commit with octokit and c#
body: <p>I have one class GitHub with one method which should return list of all commits for specific username and repo on GitHub:</p>
  
  <pre><code>using System;
  using Octokit;
  using System.Threading.Tasks;
  using System.Collections.Generic;
  
  namespace ReadRepo
  {
      public class GitHub
      {
          public GitHub()
          {
          }
  
          public async Task&lt;List&lt;GitHubCommit&gt;&gt; getAllCommits()
          {            
              string username = "lukalopusina";
              string repo = "flask-microservices-main";
  
              var github = new GitHubClient(new ProductHeaderValue("MyAmazingApp"));
              var repository = await github.Repository.Get(username, repo);
              var commits = await github.Repository.Commit.GetAll(repository.Id);
  
              List&lt;GitHubCommit&gt; commitList = new List&lt;GitHubCommit&gt;();
  
              foreach(GitHubCommit commit in commits) {
                  commitList.Add(commit);
              }
  
              return commitList;
          }
  
      }
  }
  </code></pre>
  
  <p>And I have main function which call getAllCommits method:</p>
  
  <pre><code>using System;
  using Octokit;
  using System.Threading.Tasks;
  using System.Collections.Generic;
  
  namespace ReadRepo
  {
      class MainClass
      {
  
          public static void Main(string[] args)
          {            
  
              GitHub github = new GitHub();
  
              Task&lt;List&lt;GitHubCommit&gt;&gt; commits = github.getAllCommits();
              commits.Wait(10000);
  
              foreach(GitHubCommit commit in commits.Result) {                
                  foreach (GitHubCommitFile file in commit.Files)
                      Console.WriteLine(file.Filename);    
              }
  
          }
      }
  }
  </code></pre>
  
  <p>When I run this i get following error:</p>
  
  <p><a href="https://i.stack.imgur.com/8LfXu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8LfXu.png" alt="enter image description here"></a></p>
  
  <p><strong>Problem is because this variable commit.Files is Null probably because of async call but I am not sure how to solve it. Please some help?</strong></p>