title: C# - two ways for calling this generic method. Is there any difference in?
body: <p>I use this code to load a MDIchild form from within another MDIchild form. I'm learning still how to use generics in my method so when I get my method to work finally with the help of the people here I end u with two slightly different codes which in my case do the job the same way. So my question is - is it coincidence that those two variations do the same job or there's just no difference between the two approaches.</p>
  
  <p>So here is version 1:</p>
  
  <pre><code>protected void LoadAForm&lt;T&gt;(ref T sendTo) where T : Form
  {
      MainForm frm = this.MdiParent as MainForm;
      if (frm != null)
      {
          sendTo = SingletonFormProvider.GetInstance&lt;T&gt;(frm, true);
          sendTo.MdiParent = frm;
          sendTo.Dock = DockStyle.Fill;
          sendTo.Show();
      }
  }
  </code></pre>
  
  <p>And here is version 2:</p>
  
  <pre><code>protected void LoadAForm&lt;T&gt;(ref T sendTo) where T : Form
  {
      MainForm frm = this.MdiParent as MainForm;
      T temp;
      if (frm != null)
      {
          temp= SingletonFormProvider.GetInstance&lt;T&gt;(frm, true);
          temp.MdiParent = frm;
          temp.Dock = DockStyle.Fill;
          temp.Show();
      }
  }
  </code></pre>
  
  <p>So is there (if any difference) to use the <code>T temp</code> instantiation or it's just the same thing?</p>