ASP.NET Core API only returning first result of list
<p>I have created a teams web api controller and trying to call the GET method to get the json result of all the teams in the database. But when I make the call I am only getting the first team back in the json but when I set a breakpoint on the return statement it has all 254 teams along with all of the games.</p>

<p>These are the two models that I am dealing with:</p>

<pre><code>public class Team
{
    public string Id { get; set; }
    public string Name { get; set; }
    public string Icon { get; set; }
    public string Mascot { get; set; }
    public string Conference { get; set; }
    public int NationalRank { get; set; }

    public List&lt;Game&gt; Games { get; set; }
}

public class Game
{
    public string Id { get; set; }
    public string Opponent { get; set; }
    public string OpponentLogo { get; set; }
    public string GameDate { get; set; }
    public string GameTime { get; set; }
    public string TvNetwork { get; set; }
    public string TeamId { get; set; }

    public Team Team { get; set; }
}
</code></pre>

<p>When I do this:</p>

<pre><code>[HttpGet]
public async Task&lt;List&lt;Team&gt;&gt; Get()
{
    var teams = await _context.Teams.ToListAsync();

    return teams;
}
</code></pre>

<p>I get all 254 teams but Game property is null because EF Core does not support lazy loading. So what I really want to do is add the .Include() like this:</p>

<pre><code>[HttpGet]
public async Task&lt;List&lt;Team&gt;&gt; Get()
{
    var teams = await _context.Teams.Include(t =&gt; t.Games).ToListAsync();

    return teams;
}
</code></pre>

<p>This returns the first team with the first game but nothing else. Here is the json:</p>

<pre><code>[
  {
    "id": "007b4f09-d4da-4040-be3a-8e45fc0a572b",
    "name": "New Mexico",
    "icon": "lobos.jpg",
    "mascot": "New Mexico Lobos",
    "conference": "MW - Mountain",
    "nationalRank": null,
    "games": [
      {
        "id": "1198e6b1-e8ab-48ab-a63f-e86421126361",
        "opponent": "vs Air Force*",
        "opponentLogo": "falcons.jpg",
        "gameDate": "Sat, Oct 15",
        "gameTime": "TBD ",
        "tvNetwork": null,
        "teamId": "007b4f09-d4da-4040-be3a-8e45fc0a572b"
      }
    ]
  }
]
</code></pre>

<p>When I set a break point on the return statement it shows that there are 254 teams and every team has their games populated correctly...but the json result does not reflect. Here is an image:</p>

<p><a href="https://i.stack.imgur.com/MxPcV.png"><img src="https://i.stack.imgur.com/MxPcV.png" alt="enter image description here"></a></p>

<p>I have tried doing this both synchronously and asynchronously but getting the same result. Do you know why I am only getting one result back in the json but at the breakpoint it has all of the results? </p>