title: Linq Unique Values
body: <p>i have a list of generic class which consists of 2 string property and 1 List as a property</p>
  
  <p>code snipnets is as follows:</p>
  
  <pre><code>public Class abc
  {
      public int ID { get; set; }
      public String Name { get; set; }
      List&lt;String&gt; myList;
      public List&lt;String&gt; Subjects
      {
          get
          {
              if (myList == null)
              {
                  myList = new List&lt;string&gt;();
              }
              return myList;
          }            
      }
      public abc()
      {
      }
      public abc(int id, String name, params string[] subjects)
      {
          Subjects.AddRange(subjects.AsEnumerable&lt;String&gt;());
          ID = id;
          Name = name;
  
      }
  }
  
  List&lt;abc&gt; myList = new List&lt;abc&gt;();    
   myList.Add(new abc(1, "p1", "Maths", "Science"));
   myList.Add(new abc(2, "p2", "Maths", "Art"));
   myList.Add(new abc(3, "p3", "Art", "Science"));    
   myList.Add(new abc(4, "p4", "Geometry", "Maths"));
  </code></pre>
  
  <p>I need the output as </p>
  
  <pre><code>Subject Count  Person
  
  Maths    3     p1,p2,p4
  
  Science  2     p1,p3
  
  Art      2     p2,p3
  
  Geometry 1     p4
  </code></pre>