Not able to understand the functionality of ToLookup linq extension method
<p>I am trying to figure out the functionality of ToLookup method here in the code.It's using grouping somehow to return a list. Can somebody just tell me how this is working or just guide me in the right direction:     </p>

<pre><code>.ToLookup(
  c =&gt; new 
  {
      c.CoverageType.Code, 
      c.CoverageType.Mnemonic, 
      c.CoverageType.Description, 
      c.CoverageType.CoverageLevel, 
      c.CoverageType.CoveragePosition
  })
.Select(
  t =&gt; new CoverageOption
  {
    CoverageType =
      new CoverageType
      {
          Code = t.Key.Code, 
          Mnemonic = t.Key.Mnemonic, 
          Description = t.Key.Description, 
          CoverageLevel = t.Key.CoverageLevel, 
          CoveragePosition = t.Key.CoveragePosition
      },
    Limits =
      (from Coverage c in t select c.Limit).GroupBy(l =&gt; l.Code)
        .Select(gr =&gt; gr.First()), 
    Deductibles =
      (from Coverage c in t select c.Deductible).GroupBy(d =&gt; d.Code)
        .Select(gr =&gt; gr.First())
})
.OrderBy(t =&gt; t.CoverageType.CoveragePosition);
</code></pre>
