HttpClient in using statement : <p>hi i read this article <a href="http://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/" rel="noreferrer">You're using HttpClient wrong and it is destabilizing your software</a> the article is suggesting these 2</p>

<ol>
<li>Make your HttpClient static</li>
<li>Do not dispose of or wrap your HttpClient in a using unless you explicitly are looking for a particular behaviour (such as causing your services to fail)</li>
</ol>

<p>now a newbie on c# like me would just follow it like the code posted on the article here is the original code the he said would make the application fail</p>

<pre><code>using System;
using System.Net.Http;
namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Starting connections");
            for(int i = 0; i&lt;10; i++)
            {
                using(var client = new HttpClient())
                {
                    var result = client.GetAsync("http://aspnetmonsters.com").Result;
                    Console.WriteLine(result.StatusCode);
                }
            }
            Console.WriteLine("Connections done");
        }
    }
}
</code></pre>

<p>and to fix it he gave this code:</p>

<pre><code>using System;
using System.Net.Http;
namespace ConsoleApplication
{
    public class Program
    {
        private static HttpClient Client = new HttpClient();
        public static void Main(string[] args)
        {
            Console.WriteLine("Starting connections");
            for(int i = 0; i&lt;10; i++)
            {
                var result = Client.GetAsync("http://aspnetmonsters.com").Result;
                Console.WriteLine(result.StatusCode);
            }
            Console.WriteLine("Connections done");
            Console.ReadLine();
        }
    }
}
</code></pre>

<p>now being curious like any newbie i thought of the for loop inside the using statement will the effect be the same as the latter?</p>

<p>thank you  </p>
