title: How to get distinct instance from a list by Lambda or LINQ
body: <p>I have a class like this:</p>
  
  <pre><code>class MyClass&lt;T&gt; {
      public string value1 { get; set; }
      public T objT { get; set; }
  }
  </code></pre>
  
  <p>and a list of this class. I would like to use .net 3.5 lambda or linq to get a list of MyClass by distinct value1. I guess this is possible and much simpler than the way in .net 2.0 to cache a list like this:</p>
  
  <pre><code>List&lt;MyClass&lt;T&gt;&gt; list; 
  ...
  List&lt;MyClass&lt;T&gt;&gt; listDistinct = new List&lt;MyClass&lt;T&gt;&gt;();
  foreach (MyClass&lt;T&gt; instance in list)
  {
      // some code to check if listDistinct does contain obj with intance.Value1
      // then listDistinct.Add(instance);
  }
  </code></pre>
  
  <p>What is the lambda or LINQ way to do it?</p>