Incorrectly parsed ReturnJSON method <p>This method</p> <pre><code>var fListItems = db.FListItems.Include(f =&gt; f.FList) .Include(f =&gt; f.Item) .GroupBy(g =&gt; new { g.Item.Name, g.FList.Title }) .Select(lg =&gt; new FListItemsViewModel { Title = lg.Key.Title, ItemStat = new ItemStat { Name = lg.Key.Name, NameCount = lg.Count(), NameSum = lg.Sum(w =&gt; w.Score), NameAverage = lg.Average(w =&gt; w.Score) } }); </code></pre> <p>returns this JSON</p> <pre><code>[ { Title: "Animals", ItemStat: { Name: "Cat", NameCount: 2, NameSum: 8, NameAverage: 4 } }, { Title: "Animals", ItemStat: { Name: "Dog", NameCount: 1, NameSum: 5, NameAverage: 5 } } ] </code></pre> <p>but I'd like it to return this JSON:</p> <pre><code>[ { Title: "Animals", ItemStats: [ { Name: "Cat", NameCount: 2, NameSum: 8, NameAverage: 4 }, { Name: "Dog", NameCount: 1, NameSum: 5, NameAverage: 5 } ] } ] </code></pre> <p>Can anybody suggest how to do this? Here's the viewmodel:</p> <pre><code>public class FListItemsViewModel { public string Title { get; set; } public ItemStat ItemStat { get; set; } } public class ItemStat { public string Name { get; set; } public int NameCount { get; set; } public int NameSum { get; set; } public double NameAverage { get; set; } } </code></pre> <p>Rather than <code>GroupBy</code> <code>Title</code> and <code>Name</code> in the same clause, could it be better to re-write my query with two seperate <code>GroupBy</code>s?</p> <p>Progress based on Rahul's answer:</p> <pre><code>[ { Title: "Animals", ItemStat: [ { Name: "Cat", NameCount: 2, NameSum: 8, NameAverage: 4 }, { Name: "Cat", NameCount: 2, NameSum: 8, NameAverage: 4 } ] }, { Title: "Animals", ItemStat: [ { Name: "Dog", NameCount: 1, NameSum: 5, NameAverage: 5 } ] } ] </code></pre>