Skip to content

Commit

Permalink
Corrected issue where there wouldn't be an activated generation tab o…
Browse files Browse the repository at this point in the history
…n a pokemon's page
  • Loading branch information
TheMrDew committed Apr 19, 2024
1 parent c174e9f commit defa26d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Pokedex/Pokedex/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public IActionResult Pokemon(string name)

if (generationId == 0)
{
generationId = this.dataService.GetObjects<PokemonGameDetail>("Game.GenerationId, GameId, Id", "Pokemon, Pokemon.Game, Game", "PokemonId", pokemonId).Last().Game.GenerationId;
generationId = this.dataService.GetObjects<PokemonGameDetail>("Game.GenerationId, GameId, Id", "Pokemon, Pokemon.Game, Game").Where(x => x.Game.ReleaseDate <= DateTime.UtcNow && x.PokemonId == pokemonId).Last().Game.GenerationId;
}

List<PokemonViewModel> pokemonList = new List<PokemonViewModel>();
Expand Down

0 comments on commit defa26d

Please sign in to comment.