title: LINQ Group by where key is an object
body: <p>I have an array of this object:</p>
  
  <pre><code>public class WorkingOrderContract : BaseContract, IEquatable&lt;WorkingOrderContract&gt;
  {
      public string Id { get; set; }
      public string Customer { get; set; }
      public string CategoryId { get; set; }
      public int ResourceId { get; set; }
      public virtual ResourceContract Resource { get; set; }
      public virtual CategoryContract Category { get; set; }
      public WorkingOrderEnum EWorkingOrder { get; set; }
      public TimeFlagEnum ETimeFlag { get; set; }
  
      public bool Equals(WorkingOrderContract other)
      {
          return this.Id == other.Id;
      }
  }
  </code></pre>
  
  <p>loaded dinamically by json file.</p>
  
  <p>I'm using this code to group by but it's not working</p>
  
  <pre><code>var woListGrupped = this._workingOrderList.GroupBy(wo =&gt; wo.Category,
                                 wo =&gt; wo,
                                 (k, g) =&gt; new OdlByCategoryContract(k, g.ToList())
                                 ).ToList();
  </code></pre>
  
  <p>how do I do this?</p>