title: C# Running concurrent requests using WebTestRequest
body: <p>When writing coded web tests using the Web Performance Test API. Can you write test that send requests at the same time i.e. concurrent ones, that is with one user of the load test, fire off concurrent web requests?</p>
  
  <p>edit: added extra information</p>
  
  <p>I have found out that adding requests to the dependentRequest property of another request means the dependentRequests are ran concurrently. Aside: Why is the microsoft documentation around this feature so light?</p>
  
  <p>Scenario 1: Let's say I have two web requests</p>
  
  <pre><code>public override IEnumerator&lt;WebTestRequest&gt; GetRequestEnumerator()
  {
      var request1 = new WebTestRequest("request1Uri");
      var request2 = new WebTestRequest("request2Uri");
  
      yield return request1;
      yield return request2;
  }
  </code></pre>
  
  <p>The above runs sequentially, If I want to run them(request1 and request2) simultaneously must I add a third request and run it like below, it works but wondering if there was a cleaner(without creating a third request) way? as the results are affected by adding a not needed request.</p>
  
  <pre><code>public override IEnumerator&lt;WebTestRequest&gt; GetRequestEnumerator()
  {
      var request1 = new WebTestRequest("request1Uri");
      var request2 = new WebTestRequest("request2Uri");
      var request3 = new WebTestRequest("request3Uri");
      request3.DependentRequests.AddRange(new[] { request2, request1 });
  
      yield return request3;      
  }
  </code></pre>
  
  <p>Scenario 2: From what I can see the dependent requests are just "one deep" by that I mean</p>
  
  <pre><code>public override IEnumerator&lt;WebTestRequest&gt; GetRequestEnumerator()
  {
      var request1 = new WebTestRequest("request1Uri");
      var request2 = new WebTestRequest("request2Uri");
      var request3 = new WebTestRequest("request3Uri");
      var request4 = new WebTestRequest("request4Uri");
      var request5 = new WebTestRequest("request5Uri");
  
      request3.DependentRequests.AddRange(new[] { request2, request1 });
      request5.DependentRequests.AddRange(new[] { request4, request3 });
  
      yield return request5;      
  }
  </code></pre>
  
  <p>is the same as</p>
  
  <pre><code>public override IEnumerator&lt;WebTestRequest&gt; GetRequestEnumerator()
  {
      var request1 = new WebTestRequest("request1Uri");
      var request2 = new WebTestRequest("request2Uri");
      var request3 = new WebTestRequest("request3Uri");
      var request4 = new WebTestRequest("request4Uri");
      var request5 = new WebTestRequest("request5Uri");
  
      request5.DependentRequests.AddRange(new[] { request2, request1, request4, request3 });
  
      yield return request5;      
  }
  </code></pre>
  
  <p>What if I want the first example's (in scenario 2) expected behaviour, how can I achieve this using the webTest api?</p>