title: C# Dispose object after using in list?
body: <p>I have a class and this class has "value" variable contain a big data reading from file : </p>
  
  <pre><code> public class MyClass : IDisposable
  {
      public string name {get; set;}
      public string value {get; set;} //I'm load huge data for this variable
  
      public MyClass(string name, string value)
      {
          this.name = name;
          this.value = value;
      }
  
      public void Execute()
      {
          Console.WriteLine(this.name + ":" + this.value);
      }
  
      public void Dispose()
      {
          Dispose(true);            
          GC.SuppressFinalize(this); 
      }
  
      protected virtual void Dispose(bool disposing)
      {                     
          if (disposing)
          {
              this.name = null;
              this.value = null;
          }                      
      }
  }
  </code></pre>
  
  <p>And i'm using this class in list that it's global variable</p>
  
  <pre><code>List&lt;MyClass&gt; listQ = new List&lt;MyClass&gt;() { new MyClass("1", "BIGDATA1"),
              new MyClass("2", "BIGDATA2"),
              new MyClass("3", "BIGDATA3"),
              new MyClass("4", "BIGDATA4"),
              new MyClass("5", "BIGDATA5"),
              new MyClass("6", "BIGDATA6"),
          };
  
      private void FUC_Load(object sender, EventArgs e)
      {                        
          foreach (MyClass m in listQ)
          {
              m.Execute();
              m.Dispose();
          }                       
      } 
  </code></pre>
  
  <p>So i wanna ask that if i do like that, will have any problem? My object will be disposed or not? Any the best way? Thank!</p>