title: Generic Linked List
body: <p>Before posting my question, I would like to tell you that I have no prior experience in .Net technologies and have recently started to learn C# (and WPF). My company is looking to move onto .Net technologies and I am the only one in my team learning it, so have noone apart from you guys to discuss or ask something. So if my questions are too stupid or basic at best, please bear with me.</p>
  
  <p>I was trying to create a generic linked list class to allow creation of linked lists of different types. I wrote the following code and would like to have your advise on whether I have written this code properly or not. Any suggestions to improve the code in any way is most welcome.</p>
  
  <p><strong>Main program</strong></p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          GenLinkedList&lt;string&gt; list = new GenLinkedList&lt;string&gt;("abc");
          list.AddtoList("def");
          int i = 0;
          string[] arr = new string[10];
          list.LinkedList.CopyTo(arr,0);
          for (i = 0; i &lt; list.LinkedList.Count; i++)
          {
              Console.WriteLine(arr[i]);
          }
  
          GenLinkedList&lt;int&gt; listInt = new GenLinkedList&lt;int&gt;(1);
          listInt.AddtoList(2);
          i = 0;
          int[] arrInt = new int[10];
          listInt.LinkedList.CopyTo(arrInt, 0);
          for (i = 0; i &lt; listInt.LinkedList.Count; i++)
          {
              Console.WriteLine(arrInt[i]);
          }
  
      }
  }
  </code></pre>
  
  <p><strong>Class GenLinkedList</strong></p>
  
  <pre><code>public class GenLinkedList&lt;T&gt;
  {
      private LinkedList&lt;T&gt; _linkedlist;
      public GenLinkedList(T a)
      {
          _linkedlist = new LinkedList&lt;T&gt;();
          _linkedlist.AddLast(a);
      }
  
      public LinkedList&lt;T&gt; LinkedList
      {
          get
          {
              return _linkedlist;
          }
      }
  
      public void AddtoList(T a)
      {
          LinkedList.AddLast(a);
      }
  }
  </code></pre>