title: WebApi Test Stres ASYNC .NET CORE
body: <p>I am trying to develop my first web api in .NET Core, from what I understand I need to use async/await when I am dealing with database transactions. I made a stress test on a a sync version and on the async version of the same method and the results on the async methods are awful compared with the ones on the sync method and I honestly can't understand why, maybe I am doing something wrong so I would really appreciate your help. I will leave the the methods and the test results.</p>
  
  <p>--Async Method</p>
  
  <pre><code>[HttpGet]
          public async Task&lt;IEnumerable&lt;Employer&gt;&gt; Get()
          {
              return await context.Employer.ToListAsync();
          }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/RU04C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RU04C.png" alt="Async method test results"></a>
  --Sync Method --</p>
  
  <pre><code>[HttpGet]
      public  IEnumerable&lt;Employer&gt; Get()
      {
          return  context.Employer.ToList();
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/u4ZlU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u4ZlU.png" alt="Sync method test result"></a></p>