title: What happened when I create object using new keyword in static function
body: <p>This is my code so far: </p>
  
  <pre><code>public class ServerUtility
  {
      public static int LogError(string source, string detail)
      {
          int iresult = -99;
          try
          {
              BaseRepository repo = new BaseRepository();
              using (SqlConnection con = new SqlConnection(repo.connectionString))
              {
                  con.Open();
                  using (SqlCommand cmd = new SqlCommand($"INSERT INTO [dbo].[LogError]([source],[detail],[date])VALUES('{source.Replace("'", "''")}','{detail.Replace("'", "''")}',GETDATE());SELECT @@IDENTITY", con))
                  {
                      string getValue = cmd.ExecuteScalar().ToString();
                      iresult = Convert.ToInt32(getValue);
                  } // command disposed here
  
              } //connection closed and disposed here
          }
          catch (Exception ex) { throw ex; }
          return iresult;
      }
  }
  </code></pre>
  
  <p>My question is on GetInstance method :</p>
  
  <pre><code>BaseRepository repo = new BaseRepository();
  using (SqlConnection con = new SqlConnection(repo.connectionString))
  </code></pre>
  
  <p>I am always set it as new object, on my static function, just for get constant value from AppSetting.</p>
  
  <p>What actually happened if I implement this code to my project?
  How about the performance? </p>
  
  <p>Is it cause performance issue? </p>
  
  <p>Thanks</p>