title: How do I convert from GroupBy() to object with Linq?
body: <p>The are two classes:</p>
  
  <pre><code>public class LocalizationPage
  {
      public string Title { get; set; }
      public List&lt;LocalizationItem&gt; LocalizationItemList { get; set; }
  }
  
  public class LocalizationItem
  {
      public int Id { get; set; }
      public string Key { get; set; }
      //...
  }
  </code></pre>
  
  <p>I need to get a LocalizationItem list and fill a LocalizationPage with it.</p>
  
  <p>That's how I fill the LocalizationGroups list:</p>
  
  <pre><code>var LocalizationGroupsTemp = db.Localization.GroupBy(p =&gt; p.Page);
  
  List&lt;LocalizationPage&gt; LocalizationGroups = new List&lt;LocalizationPage&gt;();
  
  foreach (var item in LocalizationGroupsTemp)
  {
      LocalizationGroups.Add(new LocalizationPage
      {
          Title = item.Key,
          LocalizationItemList = item.ToList()
      });
  }
  </code></pre>
  
  <p>How to simplify it with using Linq somehow like this?</p>
  
  <pre><code>List&lt;LocalizationPage&gt; LocalizationGroups = _context.Localization
      .GroupBy(p =&gt; p.Page)
      .Select(grp =&gt; grp.ToList())
      //...
      .ToList();
  </code></pre>