title: LINQ: Grouping By and Selecting from a List of objects based on max value
body: <p>I have the MyItem class with 3 properties as below:</p>
  
  <pre><code>class MyItem
  {
      private string _name;
      private int _value
      private DateTime _TimeStamp;
  
      public MyItem(string name, int value, string timeStamp)
      {
          this._name = name;
          this._value = value;
          this._timeStamp = DateTime.Parse(timeStamp);
      }
  
      public string Name
      { get {return this_name; } }
  
      public int Value
      { get {return this._value; } }
  
      public DateTime TimeStamp
      { get {return this._timeStamp; } }
  
      // ...
  }
  </code></pre>
  
  <p>also I have a list of MyItem as below:</p>
  
  <pre><code>var myItems = new List&lt;MyItem&gt;() {
      new MyItem("A", 123, "23/02/2012"),
      new MyItem("A", 323, "22/02/2012"),
      new MyItem("B", 432, "23/02/2012"),
      new MyItem("B", 356, "22/02/2012"),
      // ...
  }
  </code></pre>
  
  <p>how can I GROUP BY myList so that I am ONLY left with the items that have Maximum TimeStamp? ie the result below:</p>
  
  <pre><code>"A"  123  23/02/2012&lt;br&gt;
  
  "B"  432  23/02/2012&lt;br&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>