title: Correct way to dispose object in C#?
body: <p>Hi I'm new in this great community and I have my first question. Hope this one is in the right place (and I hope my english is correct):</p>
  
  <p>I'm novice developer and I have to improve a C# Application, so I've found this code and <strong>I want to know if this is the right way to do it</strong>:</p>
  
  <pre><code>ObjClass obj = new ObjClass();
  obj.SomeText = TextBox1.Text;
  obj.SomeNumber = Convert.ToInt32(TextBox2.Text);
  </code></pre>
  
  <p>The definition of ObjClass is the following:</p>
  
  <pre><code>    using System;
  
  namespace SomeObject
  {
      public class ObjClass : IDisposable
      {
          public string SomeText { get; set; }
          public int SomeNumber{ get; set; }
  
          public void Dispose()
          {
              GC.SuppressFinalize(this); 
          }
      }
  }
  </code></pre>
  
  <p>Then after using the object the code to finalize or disposing the objecto is the following:</p>
  
  <pre><code>if(obj.SomeNumber != null)
  {
      //doing something else
      obj.Dispose();
  }
  </code></pre>